请写出下列语句的输出结果:System.out.println(String.valueOf(10D));System.out.println(String.valueOf(3>2));
举一反三
- 中国大学MOOC: 下列代码中构造方法的返回类型是()public class Village { Village () { System .out .println(“hiding in Village”) ; } public static void main( String args [ ]) { Village c =new Village ( ) ;}class Village { public static void main( String args [ ]) { Village c =new Village ( ) ; } Village () { System .out .println(“hiding in Village”) ; } }
- 请看下面的程序代码,当 n 为( )值时,程序段将输出字符串 second。 [br][/br] switch(n) { [br][/br] case 0: System .out .println(“first”); [br][/br] case 1: [br][/br] case 2: System .out .println(“second”); break; [br][/br] default: System .out .println(“end”); [br][/br] }(2.0) A: 0 B: 1 C: 2 D: 以上都可以
- 请写出下列语句的输出结果: System.out.println(String....tring.valueOf(3>2));
- 下列输出结果为false的是( ) String s1 = new String("SUN"); String s2 = new String("SUN"); A: System.out.println(s1 == s2); B: System.out.println(s1.equals(s2)); C: System.out.println(s1 = s2); D: System.out.println(s1.equals("SUN"));
- 请阅读程序,然后写出程序运行结果。 public class Demo { public static void main(String args[]) { String s1 = new String("good"); String s2 = new String("GOOD"); String s3 = new String("good"); String s4 = "good"; boolean b1 = s1.equals(s2); boolean b2 = s1.equalsIgnoreCase(s3); boolean b3 = s2.endsWith("oD"); boolean b4 = (s1 == s4); System.out.println(b1); System.out.println(b2); System.out.println(b3); System.out.println(b4); } }