网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
Given a class Repetition: 1.package utils; 2. 3.public class Repetition{ 4.public static String twice(Strings){returns+s;} 5.} and given another class Demo: 1.//insert code here2. 3.public class Demo{ 4.public static void main(String[]args){ 5.System.out.println(twice("pizza")); 6.} 7.} Which code should be inserted at line 1 of Demo.java to compile and run Demo to print“pizzapizza”?()
- A、import utils.*;
- B、static import utils.*;
- C、importutils.Repetition.*;
- D、static importutils.Repetition.*;
- E、import utils.Repetition.twice();
- F、import static utils.Repetition.twice;
- G、static import utils.Repetition.twice;
参考答案
更多 “ Given a class Repetition: 1.package utils; 2. 3.public class Repetition{ 4.public static String twice(Strings){returns+s;} 5.} and given another class Demo: 1.//insert code here2. 3.public class Demo{ 4.public static void main(String[]args){ 5.System.out.println(twice("pizza")); 6.} 7.} Which code should be inserted at line 1 of Demo.java to compile and run Demo to print“pizzapizza”?()A、import utils.*;B、static import utils.*;C、importutils.Repetition.*;D、static importutils.Repetition.*;E、import utils.Repetition.twice();F、import static utils.Repetition.twice;G、static import utils.Repetition.twice;” 相关考题
考题
现有: class Passer f static final int X=5; public static void main (String [] args) { new Passer().go (x); System. out .print (x); } void go (int x) { System. out .print(x++); } 结果是什么?() A、55B、56C、65D、66
考题
class Number { public static void main(String [] args) { try { System.out.print(Integer.parseInt("forty ")); } catch (RuntimeException r) { System.out.print("runtime "); } catch (NumberFormatException e) { System.out.print("number "); } } } 结果是什么?() A、fortyB、numberC、runtimeD、编译失败
考题
String s= "hello"; String t = "hello"; char c[] = {’h’,’e’,’l’,’l’,’o’} ; Which return true?() A、 s.equals(t);B、 t.equals(c);C、 s==t;D、 t.equals(new String("hello"));E、 t==c;
考题
class TestApp{ public static void main(String[] args){ System.out.println(multiply(2,3,4,5)); } public int multiply(int... nums){ int result=1; for(int x:nums) result*=x; return result; } } 程序运行后的输出是哪项?() A、120B、24C、14D、编译错误
热门标签
最新试卷