执行下面代码后,输出的结果为()public class Test {public static void main(String[] args) {String s1="hello";String s2=new String(s1);if(s1==s2)System.out.println("s1==s2");elseSystem.out.println("s1!=s2");if(s1.equals(s2))System.out.println("s1 equals s2 ");elseSystem.out.println("s1 not equals s2");}}
A. s1==s2s1 equals s2
B. s1!=s2s1 equals s2
C. s1==s2s1 not equals s2
D. s1!=s2s1 not equals s2
查看答案
有语句“String s="hello world";”,以下操作不合法的是()
A. s>>>=1;
B. int i=s.length();
C. String ts=s.trim();
D. String t=s+"!";
下列选项中,编译正确的选项为( )
A. System.out.println(Math.max(x));
B. System.out.println(Math.random(10,3));
C. System.out.println(Math.round(20,5));
D. System.out.println(Math.sqrt(10));
下列选项中,()将会输出1~10的随机数
A. System.out.println(Math.round(Math.random()*10));
B. System.out.println(Math.round(Math.random()%10));
C. System.out.println(Math.random()*10);
D. 以上都不对
在Java中,实现用户界面功能的包是()
A. java.applet
B. java.util
C. java.io
D. java.awt