更多"下面程序执行后的输出结果为( )。 public class fu"的相关试题:
[单项选择]下面程序执行后的输出结果为( )。 public class fun { public static void main(String args[]) { String greets = " How are you!"; String s = greets.substring(0,3); System.out.println(s); } }
A. How
B. are
C. you
D. how are you!
[单项选择]下面程序段的输出结果为 public class MyClass { public static void main(String args[]) { String s="Helto! How are you"; System.out.println(s.lastlndexOf("o",16)); } }
A. 16
B. o
C. u
D. 17
[单项选择]下面程序段的输出结果为 public class MyClass { public static void main(String args[]) { String s="Hello! How are you"; System.out.println(s.LastIndexOf("o",16); } }
A. 16
B. o
C. u
D. 17
[单项选择]下面程序的输出结果为( )。 public class Test { public static void main (String args[]) { String X="ABCD"; String Y="EFG"; X=X.substring (X.length( )-Y.length( )); System.out.println(X); } }
A. ABC
B. BCD
C. EFG
D. ABCDEFG
[单项选择]下面程序的输出结果是( )。 public class Sun { public static void main(String args[ ]) { int n=4 ,sum=0; while (n>0) { sum+=n; n--; } System.out.println("sum is "+sum); } }
A. sum is 10
B. sum is 4
C. 10
D. 4
[单项选择]下面程序的输出结果是( )。 public class Sun { public static void main(String args[ ]) { int n=4 ,sum=0; while(n>0) { sum+=n; n--; } System.out.println("sum is "+sum); } }
A. sum is 10
B. sum is 4
C. 10
D. 4
[单项选择]下面程序段的输出结果是 public class Test{ public static void main(String args[]){ int n=5,sum=O; while(n>0){ sum+=n; --n; } System.out.println("sum is "+Sum); } }
A. sum is 14
B. sum is 15
C. sum is 10
D. sum is 5
[单项选择]下面程序段的输出结果是 public class Test{ public static void main(String args[]){ int n=5,sum=0; while(n>0){ sum+=n; --n; } System.out.println("sum is"+sum); } }
A. sum is 14
B. sum is 15
C. sum is 10
D. sum is 5
[单项选择]下面程序的输出结果是 ( )public class ex2{ public static void main(String []args) { for(int cnt=1;cnt<=10;cnt++) { if(cnt<=5) continue; System.out.print(cnt+""); } }}
A. 1 2 3 4
B. 6 7 8 9
C. 1 2 3 4 6 7 8 9 10
D. 6 7 8 9 10
[单项选择]下面程序段的输出结果是( )。 public class Test { public static void main (String[] args) { int sum=0; for ( int i=0;i<=100; i++) sum+=i; System. out. println ("sum="+sum); } }
A. sum =5050
B. sum=4950
C. sum=0
D. sum=100
[单项选择]执行下面程序后输出的正确结果是 public class Test{ public static void main(String args[]){ System.out.print(100%3); System.out.print(","); System.out.print(100%3.0); } }
A. 1,1
B. 1,1.0
C. 1.0,1
D. 1.0,1.0
[单项选择]执行下面程序后输出的正确结果是 Public class Test { public static void main(String args[]){ byte x=3,y=4; long r=80L; System.out.print(r/y); System.out.print(”,”); System.out.print(x/y); } }
A. 20.0,1
B. 20.0,1.0
C. 20,0
D. 20,1.0
[单项选择]执行下面程序后输出的正确结果是 public class Test{ public static void main(String args[]){ byte x=3,y=4; long r=80L; System.out.print(r/y); System.out.print(","); System.out.print(x/y); } }
A. 20.0,1
B. 20.0,1.0
C. 20,0
D. 20,1.0
[单项选择]执行下面程序后输出的正确结果是 public class Test{ public stoic void main (String args[]){ byte x=3, y=4; long r=80L; System.out.print(r/y); System.out.print(","); System.out.print(x/y); } }
A. 20.0, 1
B. 20.0, 1.0
C. 20,0
D. 20, 1.0