Given classes defined in two different files: 1.package util; 2.public class BitUtils{ 3.private static void process(byte[]b){} 4.} 1.package app; 2.public class SomeApp{ 3.public static void main(String[]args){ 4.byte[]bytes=newbyte[256]; 5.//insert code

题目

Given classes defined in two different files: 1.package util; 2.public class BitUtils{ 3.private static void process(byte[]b){} 4.} 1.package app; 2.public class SomeApp{ 3.public static void main(String[]args){ 4.byte[]bytes=newbyte[256]; 5.//insert code here 6.} 7.} What is required at line 5 in class SomeApp to use the process method of BitUtils?()

  • A、process(bytes);
  • B、BitUtils.process(bytes);
  • C、app.BitUtils.process(bytes);
  • D、util.BitUtils.process(bytes);
  • E、importutil.BitUtils.*;process(bytes);
  • F、SomeApp cannot use the process method in BitUtils.
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Givenclassesdefinedintwodifferentfiles:1.packageutil;2.publicclassBitUtils{3.publicstaticvoidprocess(byte[]){/*morecodehere*/}4.}1.packageapp;2.publicclassSomeApp{3.publicstaticvoidmain(String[]args){4.byte[]bytes=newbyte[256];5.//insertcodehere6.}7.}Whatisrequiredatline5inclassSomeApptousetheprocessmethodofBitUtils?()

A.process(bytes);

B.BitUtils.process(bytes);

C.util.BitUtils.process(bytes);

D.SomeAppcannotusemethodsinBitUtils.

E.importutil.BitUtils.*;process(bytes);


参考答案:C

第2题:

以下是JAVA中正确的入口方法是? () 

  • A、 public static void main(String[] args){}
  • B、 public static void main(String args){}
  • C、 public void main(String[] args){}
  • D、 public static int main(String[] args){}

正确答案:A

第3题:

下列语句输出结果为( )。public class test{public static void main(String args[]){byte b=OXA;System.out.println(b);}}

A.OXA

B.A

C.1

D.10


正确答案:D

第4题:

11. static class A {  12. void process() throws Exception { throw new Exception(); }  13. }  14. static class B extends A {  15. void process() { System.out.println(”B”); }  16. }  17. public static void main(String[] args) {  18. new B().process();  19. }  What is the result?() 

  • A、 B
  • B、 The code runs with no output.
  • C、 Compilation fails because of an error in line 12.
  • D、 Compilation fails because of an error in line 15.
  • E、 Compilation fails because of an error in line 18.

正确答案:A

第5题:

1. public class A {  2. void A() {  3. System.out.println(“Class A”);  4. }  5. public static void main(String[] args) {  6. new A();  7. }  8. }  What is the result?()  

  • A、 Class A
  • B、 Compilation fails.
  • C、 An exception is thrown at line 2.
  • D、 An exception is thrown at line 6.
  • E、 The code executes with no output.

正确答案:E

第6题:

Given classes defined in two different files:What is required at line 5 in class SomeApp to use the process method of BitUtils?()

A.process(bytes);

B.BitUtils.process(bytes);

C.app.BitUtils.process(bytes);

D.util.BitUtils.process(bytes);

E.import util.BitUtils.*; process(bytes);

F.SomeApp cannot use the process method in BitUtils.


参考答案:F

第7题:

Which declarations will allow a class to be started as a standalone program?()  

  • A、public void main(String args[])
  • B、public void static main(String args[])
  • C、public static main(String[] argv)
  • D、final public static void main(String [] array)
  • E、public static void main(String args[])

正确答案:D,E

第8题:

Given classes defined in two different files:1.package util;2.public class BitUtils{3.private static void process(byte[]b){}4.}1.package app;2.public class SomeApp{3.public static void main(String[]args){4.byte[]bytes=newbyte[256];5.//insert code here6.}7.}What is required at line 5 in class SomeApp to use the process method of BitUtils?()

A.process(bytes);

B.BitUtils.process(bytes);

C.app.BitUtils.process(bytes);

D.util.BitUtils.process(bytes);

E.importutil.BitUtils.*;process(bytes);

F.SomeApp cannot use the process method in BitUtils.


参考答案:F

第9题:

下列有关main()方法的签名正确的是哪些?()

  • A、 public static void main(String[] args){}
  • B、 public static void main(){}
  • C、 public static void main(String args[]){}
  • D、 public void static main(String[] args){}

正确答案:A,C

第10题:

声明Java独立应用程序main()方法时,正确表达是()。

  • A、public static void main(String[]args){…}
  • B、private static void main(String args[]){…}
  • C、public void main(String args[]){…}
  • D、public static void main(){…}

正确答案:A

更多相关问题