Understanding the error "can not find a character"

What is this mistake?

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

Java is case sensitive. Since "getstring" is not equal to "getString", the compiler considers that the getstring method does not exist in the InternalFrameDemo class and throws this error.

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

+11
source

, InternalFrameDemo getstring() - "getString" "S"?

+2

Perhaps this suggests that InteranlFrameDemo does not have a getstring method that takes a String argument. Perhaps the method should be getString ("mystring")?

method names are case sensitive in java, so I assume this is

+1
source

Maybe getstring () should be getString ()?

This basically suggests that the InternalFrameDemo method does not have a getstring () method.

0
source

This is simply because Java is case sensitive. Try getString () instead of getstring (). Java usually uses Camel notation.

0
source

Source: https://habr.com/ru/post/1698068/


All Articles