Java dishes title

Programming languages: the Java

 2019 National Computer Skills Challenge university is divided into a large data algorithm tournament

First, the choice (a total of 15 questions, each question 3 points, a total of 45 points)

1. In Java, the following statement is correct ()

A, a subclass can have more than one parent class, a parent class may be multiple sub-class

B, a subclass can have more than one parent class, but only one parent class can have a subclass

C ,  a subclass can be a parent, but a parent can have multiple children classes

D, the above statement is not right

 

2. About Java garbage collection mechanism is not correctly describe ()

A, garbage collection does not call the appropriate methods required by a program can also be started automatically.

B, Java program () method must be able to perform garbage collection with System.gc;

C, automatic garbage collection operation belonging jvm, java program garbage collection operation may not be performed.

D, garbage collection is not performed automatically by the operating system.

 

3. in the field of object-oriented dominant standard modeling language ()

   A , C ++ B , Java C , C #    D , UML

 

4. In the Java language, the following () does not belong to the basic data types.  

A、 int    B、boolean    C、 String    D、 double

 

5. Java language inheritance relationship between classes is (  ).

A, single inheritance B, multiple inheritance C, not inherit D, not necessarily

 

6. The following description of the method of construction is correct ().

A, constructor return type only void type.

B, constructor method is a special class of functions, which must be the same method name class name.

C, the main role is to complete the object constructor for class initialization.

D, generally when you create a new object, the system will automatically call the constructor.

 

7. The following java runtime environment on the wrong argument is  ().

A, CLASSPATH is loaded Java classes (class or lib) path.

B, Java.exe is used to explain the implementation of Java class files.

C, the effect JAVA_HOME JDK installation path is specified, for example, may be arranged to C: \ Program Files \ Java \ jdk1.6.0_01.

D, programs written in the Java language is platform-independent, so I do not need to configure the operating environment of java.

 

8. The following options, which item does not belong to the "auto" attribute (   ).

A, Brand       B, brakes        C, Price D, speed

 

9. The relationship between these two items are not part of inheritance ()

    A, card and bank card B , and automobile tires    C, and students D, animals and dogs

 

10. The relationship between the two classes and objects comply with the following terms are relations ()

A, vehicles and electric cars   B, and Shepherd dogs

C, building and room D, and library books

 

11. With regard to the string, the following code is written is not correct ()
A, STR = new new String String ();

B、 String str = “Hello”+“ACCP”;
C、 String str = “123”+“Hello World!”;
D、 StringBuffer strBuf = new StringBuffer(“Hello World!”);
    String str = strBuf;

 

12. The following options are wrong to say about the super keyword in Java is ().

A, super keyword is a parent class to refer to references to objects within the subclass object

B, super keywords may refer not only to the direct parent generations subclass, you can also refer to the parent class parent generations

C, subclass can call parent class by super keyword

D, subclass can call up the properties of the parent class by super keyword

 

13. The following Java code written error is ()

   class Pet{      }

   class Dog extends Pet{}

   class Test{

   public static void t(Pet p){}

   }

    A、Pet p = new Pet(); Test.t(p);     B、Pet p = new Dog(); Test.t(p);

    C、Dog p = new Dog(); Test.t(p);     D、Dog p = new Pet(); Test.t(p);

 

 

14. With regard to the following code statement is correct (    ).

     public class Test{

     public void a(){}

     public void a(int i){}

     public int  a(){}

     }

     A, the above three methods is a method overload  

     B, the above three methods is a method overrides

     C, the above code compiler pass

     D, the above three methods is the first and the second method is a method of rewriting, the compiled method will be a third problem.

 

15. If a class file named Student.java, class code:

public class  Student {

public static void main(String[] args) {

System.out.println(4<<2);

}}

The following statement is correct :(    )

A, it is a result of the program 1; B, 2 is the result of the program;

C, is a result of the program 16;    D, program compilation errors, can not run;

Guess you like

Origin www.cnblogs.com/dgwblog/p/11724997.html