Java – understand the “symbol not found” error
•
Java
What is this mistake?
cannot find symbol,symbol: method getstring(java.lang.String) Location: class InternalFrameDemo if <!windowTitleField.getText().equals(getstring("InternalFrameDemo.frame_label")))
Solution
Java is case sensitive Because "getString" is not equal to "getString", the compiler considers that there is no "getString" method in the internalframedemo class and throws the error
In Java, methods usually have the first letter of each word after the first word is capitalized (e.g. tostring(), touppercase(), etc.), the class will use upper camel case (e.g. classname, string, StringBuilder), and the constant will be at the full upper limit (e.g. max_value)
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码