高等继续教育 / Java程序设计
正确率:100%
【Java程序设计】模拟试题
写出下面程序的运行结果import java.io.*;public class abc{ public static void main(String args[ ]){ AB s = new AB("Hello!","I love JAVA.");System.out.println(s.toString( ));}}class AB {String s1;String s2;publicAB(String str1, String str2){ s1 = str1; s2 = str2; }public String toString( ){ return s1+s2;}}
考题内容:
写出下面程序的运行结果 import java.io.*;public class abc{ public static void main(String args [ ]){ AB s = new AB("Hello!","I love JAVA."); System.out.println(s.toString( )); }}class AB { String s1; String s2; public AB(String str1, String str2) { s1 = str1; s2 = str2; } public String toString( ) { return s1+s2;}}
写出下面程序的运行结果import java.io.*;public class abc{ public static void main(String args[ ]){ AB s = new AB("Hello!","I love JAVA.");System.out.println(s.toString( ));}}class AB {String s1;String s2;publicAB(String str1, String str2){ s1 = str1; s2 = str2; }public String toString( ){ return s1+s2;}}
考题内容:
写出下面程序的运行结果 import java.io.*;public class abc{ public static void main(String args [ ]){ AB s = new AB("Hello!","I love JAVA."); System.out.println(s.toString( )); }}class AB { String s1; String s2; public AB(String str1, String str2) { s1 = str1; s2 = str2; } public String toString( ) { return s1+s2;}}
参考答案:
佳题速递: