首页 > 试题广场 >

写出下列程序的运行结果:

[问答题]
写出下列程序的运行结果:

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;

AB( String  str1 , String  str2 )

{  s1 = str1;  s2 = str2; }

public   String   toString( )

{ return  s1+s2;}

}

Hello! I  love  JAVA.

发表于 2017-05-17 02:40:00 回复(0)