正在加载图片...
public static void main(String args [] AB s=new AB("Hello!","I love JAVA."); System.out.println(s.toString()); } } class AB{ Strings1; String s2; public AB(String str1,String str2) s1=strl; s2 =str2; } public String toString(){ return s1+s2; 》 2)程序的输出结果是 importjava.io.*; public class abc JAVA程序设计》A卷第6页共8页 《JAVA 程序设计》A 卷 第 6 页 共 8 页 { 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; }} 2) 程序的输出结果是 import java.io.* ; public class abc {
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有