public class Hello{ int f(){ return "hello word"; }public static void main(String[] args){Hello a = new Hello(); int x = a.f(); System.out.println("x = " + x);} }程序哪错了
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 09:34:19
public class Hello{ int f(){ return "hello word"; }public static void main(String[] args){Hello a = new Hello(); int x = a.f(); System.out.println("x = " + x);} }程序哪错了
public class Hello{ int f(){ return "hello word"; }
public static void main(String[] args){
Hello a = new Hello();
int x = a.f();
System.out.println("x = " + x);
}
}
程序哪错了
public class Hello{ int f(){ return "hello word"; }public static void main(String[] args){Hello a = new Hello(); int x = a.f(); System.out.println("x = " + x);} }程序哪错了
public class Hello {
public String f(){
return "hello word";
}
}
public static void main(String[] args){
Hello a = new Hello();
String x = a.f();
System.out.println("x = " + x);
}
}
public class Hello {
public int f(){
return 123;
}
}
public static void main(String[] args){
Hello a = new Hello();
int x = a.f();
System.out.println("x = " + x);
}
}