了解“找不到符号”错误

时间:2023-01-25 19:57:12

What is this error?

这个错误是什么?

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

5 个解决方案

#1


11  

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.

Java区分大小写。因为“getstring”不等于“getString”,所以编译器认为InternalFrameDemo类中不存在“getstring”方法并抛出该错误。

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)

在Java中,方法通常会在第一个单词大写之后具有每个单词的第一个字母(例如toString(),toUpperCase()等),类将使用Upper Camel Case(例如ClassName,String,StringBuilder)和常量将是全部大写(例如MAX_VALUE)

#2


2  

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

这意味着类InternalFrameDemo没有getstring()方法 - 不应该是带有大写“S”的“getString”吗?

#3


1  

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")?

也许它说InteranlFrameDemo中没有一个名为getstring的方法,它接受一个String参数。可能是getString(“mystring”)的方法?

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

方法名在java中区分大小写,这就是我猜这个的原因

#4


0  

Perhaps getstring() should be getString()?

也许getstring()应该是getString()?

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

基本上它是说InternalFrameDemo没有getstring()方法。

#5


0  

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

这只是因为Java区分大小写。尝试使用getString()而不是getstring()。 Java通常使用Camel表示法。

#1


11  

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.

Java区分大小写。因为“getstring”不等于“getString”,所以编译器认为InternalFrameDemo类中不存在“getstring”方法并抛出该错误。

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)

在Java中,方法通常会在第一个单词大写之后具有每个单词的第一个字母(例如toString(),toUpperCase()等),类将使用Upper Camel Case(例如ClassName,String,StringBuilder)和常量将是全部大写(例如MAX_VALUE)

#2


2  

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

这意味着类InternalFrameDemo没有getstring()方法 - 不应该是带有大写“S”的“getString”吗?

#3


1  

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")?

也许它说InteranlFrameDemo中没有一个名为getstring的方法,它接受一个String参数。可能是getString(“mystring”)的方法?

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

方法名在java中区分大小写,这就是我猜这个的原因

#4


0  

Perhaps getstring() should be getString()?

也许getstring()应该是getString()?

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

基本上它是说InternalFrameDemo没有getstring()方法。

#5


0  

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

这只是因为Java区分大小写。尝试使用getString()而不是getstring()。 Java通常使用Camel表示法。