Ok, i searched the forum for "unresolved problem" and I either didnt understand something that could have helped me or it wasn't pertinant to my problem. So here goes and hopefully someone can lend a hand.
I have a method with in my program that is called "public static boolean beginsWithVowel(String word)" I then have a method called "public static String translateWord(String word)." I would like to use the first method I mentioned to in the second method i mentioned.
What i have to do is this, if a word starts with a vowel, i need to translate it to pig latin my concatenating "yay" to the end of that word. I call the first method like thus...." if(word.beginsWithVowel()) { word = word + "yay "; }" however i get an error which is the following " cannot resolve symbol Symbol :method beginsWithVowel () location: class java.lang.String if(word.beginsWithVowel()) ^
No help available"
No idea what the hell that means, i though you could use a method in another method. It is all within the same class so i dont know why it cant find it... My IDE is BlueJ version 1.2.2 (Java version 1.4.0) im running Win2k Pro i saw someone ask this stuff in the other posts so i thought i would tell you it.
If anyone can tell me my(and im sure its a simple one) mistake i would greatly appreciate it.
The reason word.beginsWithVowel() doesn't work is that word is a string and string is final, so you cannot extend that class.
Since beginsWithVowel() is static, you use it without a class instance. Since you are in the class, the "this." part is assumed.
I'd suggest you find a tool that supplies syntax highlighting (not a full-blown IDE as that will mask your shortcoming) and possibly auto-completion. That way when you type beginsWithVowel(, the tools will show you "String)"...