以下System.out.println(Math.sqrt(16)); System.out.println(Math.pow(3, 2)); System.out.println(Math.max(2.3, 4.5)); 代码中的输出正确的是
2.0,9.0,4.5
举一反三
- 以下System.out.println(Math.sqrt(16));System.out.println(Math.pow(3,2));System.out.println(Math.max(2.3,4.5));代码中的输出正确的是A.4.0,3.0,2.3B.2.0,9.0,4.5C.2.0,3.0,4.5D.4.0,9.0,4.5
- 请看下面的程序代码,当 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: 以上都可以
- 中国大学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”) ; } }
- 【单选题】对于下面代码,正确的Java源程序文件名是( )。 class A { void method1() { System. out .println( "Method1 in class A" ); } } public class B { void method2() { System. out .println( "Method2 in class B" ); } public sta
- 以下程序段的输出结果为 【14】 。int x=0,y=4,z=5;if(x>2)if(y<5)System. out. println("Message one");elseSystem. out . println("Message two");else if(z>5)System. out. println("Message three");elseSystem. out. println("Message four");
内容
- 0
以下哪个是Java ArrayList 类的方法? A: add B: println C: import D: System
- 1
以下代码段的输出结果为1. int x = 0, y = 4, z = 5;2. if (x > 2) {3. if (y < 5) {4. System. out .println ( "message one" );5. }6. else {7. System.out.println( "message two");8. }9. }10. else if (z > 5) {11. System.out.println("message three");12. }13. else {14. System.out.println( "message four");15. } A: message one B: message two C: message three D: message four
- 2
System类中的println()方法分行显示信息,而print()方法不分行显示信息
- 3
I ________to go out of the classroom by my math teacher.
- 4
以下哪个类不是java.lang包中的( ) A: System B: String C: Math D: Scanner
