嗨,我收到了错误:
找不到符号 - 此方法的变量 Andrew。
我需要改变什么?
/**
* Create a method that says hi if the name is the same as yours and go away otherwise.
*
* @author (your name)
* @version (a version number or a date)
*/
public class String
{
public void greeting(String name) {
String myName;
myName = Andrew;
if (name == myName) {
System.out.println("Hi");
}
else {
System.out.println("Go away");
}
}
}