NeroVBNet
NeroVBNet

Reputation:

Understanding the "cannot find symbol" error

What is this error?

cannot find symbol, symbol: method getstring(java.lang.String) 
Location: class InternalFrameDemo 
if <!windowTitleField.getText().equals(getstring("InternalFrameDemo.frame_label")))

Upvotes: 3

Views: 2141

Answers (5)

Glitch
Glitch

Reputation: 2785

It's just because Java is case sensitive. Try getString() instead of getstring(). Java generally uses Camel notation.

Upvotes: 0

Cristian Sanchez
Cristian Sanchez

Reputation: 32127

Java is case-sensitive. Because "getstring" is not equal to "getString", the compiler thinks the "getstring" method does not exist in the InternalFrameDemo class and throws back that error.

In Java, methods will generally have the first letter of each word after the first word capitalized (e.g. toString(), toUpperCase(), etc.), classes will use Upper Camel Case (e.g. ClassName, String, StringBuilder) and constants will be in all caps (e.g. MAX_VALUE)

Upvotes: 11

abarax
abarax

Reputation: 6299

Perhaps getstring() should be getString()?

Basically it is saying InternalFrameDemo has no getstring() method.

Upvotes: 0

Eric Tuttleman
Eric Tuttleman

Reputation: 1320

Maybe it's saying that there isn't a method in InteranlFrameDemo called getstring that takes a String argument. Possibly is the method supposed to be getString("mystring")?

method names are case-sensitive in java, which is why I'm guessing this

Upvotes: 1

Draemon
Draemon

Reputation: 34711

it means that the class InternalFrameDemo has no getstring() method - shouldn't that be "getString" with an uppercase "S"?

Upvotes: 2

Related Questions