Results 1 to 3 of 3
  1. #1
    jfill is offline Member
    Join Date
    May 2010
    Posts
    2
    Rep Power
    0

    Default The method myFunction(String) is undefined for the type

    Ok I am trying to create a very simple class to see how it all works, but I keep running into issues.

    The class that is being called is below. It is very simple just to try to get it working.

    Java Code:
    public class Hmac {
    	public String myFunction(String encryptionKey){
    		return "Hi";
    	}	
    }
    Below is the code I am using to try to call the function.

    Java Code:
    String encryptionKey = "eUSMozLGp9fl03gZ";
    Hmac h = new Hmac();	
    String newResult = h.myFunction(encryptionKey);
    Everytime I call the function I get this:

    The method myFunction(String) is undefined for the type Hmac
    30:
    31: Hmac h = new Hmac();
    32:
    33: String newResult = h.myFunction(encryptionKey);


    If I removed the "encryptionkey" argument and modify the class to not take any arguments it works, but when I just try to pass an argument in it does not work.

    Any help would be great as I am totally stumped!

    Thanks

    Jason

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

  3. #3
    jfill is offline Member
    Join Date
    May 2010
    Posts
    2
    Rep Power
    0

    Default

    man oh man, yeah that was the issue. I though it was rebuilding each save but I guess not. I am using MyEclipse so I just went to project > clean and that took care of it. While that worked, is that the correct method? I am in the learning stage right now.;).

Similar Threads

  1. Replies: 7
    Last Post: 11-03-2009, 02:18 AM
  2. Static String Return Type
    By Java_Developer in forum New To Java
    Replies: 17
    Last Post: 10-03-2009, 06:07 PM
  3. Replies: 0
    Last Post: 05-27-2009, 04:39 PM
  4. [SOLVED] Cast string type to int type
    By GilaMonster in forum New To Java
    Replies: 9
    Last Post: 09-17-2008, 10:43 AM
  5. dentify the language type from a given String.
    By vaskarbasak in forum Advanced Java
    Replies: 18
    Last Post: 07-31-2008, 10:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •