//Red callout as Error
11. For the construction method, the following description is correct: (AC)
A. The method name of the construction method must be the same as the class name;
B. The construction method must use the Void Declaration return type (no return type)
C. Construction methods can be called by the program
D. If the programmer does not define the construction method in class, the program will error.
12. For the different methods of the same name that are overloaded in the district classification, require: (A)
A. Using a different form parameter list
B. Return the data types that are worth different (regardless of return value)
C. Prefix with the class name or object name when calling
D. The name of the parameter is different (Parameter List---parameter number, parameter type)
13. The following is a description of the subclass inheriting the parent class constructor, where the correct is: (C)
A. When you create an object of a subclass, call the subclass's own constructor, and then call the parent class's constructor. (call the constructor of the parent class first)
B. Subclasses can not call the constructor of the parent class (The constructor of a subclass can implicitly invoke the parameterless constructor of the parent class)
C. Subclasses must invoke the constructor of the parent class through the super () keyword
D. Subclasses cannot inherit the constructor of the parent class.(IBID.)
14. In the following statements, it is correct that: (A)
A. Class is a collection of variables and methods
B. An array is a collection of unordered data (type can be any data type in Java, including simple type combination types)arrays are collections of ordered data
C.abstract classes can be instantiatedCannot instance
D. Class member data must be public
15. The following is not available as the Java language Identifier (D)
A) A1 B) $ C) _1 D) 11 (cannot start with a number)
16. There is a Java application, its main class name is A1, then save its source file name can be (a)
A) A1.java B) A1.class (Javaclass file) C) A1 D) are
17. The minimum amount of memory space required for an integer data type is (D)
A) Short (2 bytes)
B) long (8 bytes)
C) Int (4 bytes)
D) Byte (1 bytes)
Java classes can be used as (C)
A) type definition mechanism
B) Data Encapsulation mechanism
C) type definition mechanism and data encapsulation mechanism
D) None of the above is true
19. When creating an object, you must (C)
A) Declare the object before you can use the object
B) Declare the object, allocate memory space for the object, and then use the object
C) First declare the object, allocate memory space for the object, initialize the object, and then use the object
D) The above statements are
20. To make the method change the value of the argument when the method is called, you Can (B)
A) Use basic data types as parameters
B) Use the object as a parameter
C) Both A and B are
D) Both A and B are not
Https://zhidao.baidu.com/question/1959395493986765260.html
-
For the basic type, when passing, the argument value is copied, the method obtains the shape participates in the actual parameter does not have the relation, only the value is the same, is called the value passing, modifies the parameter in the method does not affect the actual parameter;
-
For an object, when passed, the argument reference is copied, the shape participates in the argument reference the same, pointing to the same object, referred to as the reference pass , in the method to modify the shape of the participant effect argument;
-
There is an exception to this, and for immutable classes like string, it is still a reference pass , with the same formal parameter and argument. But when you modify it, you create a new object to assign to the parameter, which of course does not affect the argument.
In Java (C)
A) A subclass can have more than one parent class, and a parent class can have multiple subclasses(single inheritance only)
B) A subclass can have more than one parent class, but a parent class can have only one subclass
C) A subclass can have a parent class, but a parent class can have more than one child class
D) None of the above statements are correct
22.Java language has many advantages and characteristics, which reflects the characteristics of Java program parallelism mechanism? B
A) SecuritySandbox security ModelHttp://www.cnblogs.com/mfrbuaa/p/4687195.html
B) Multi-linear
C) Cross-platform http://blog.csdn.net/jack_lantern/article/details/52136103
D) Portable http://jingyan.baidu.com/article/148a19216eef954d71c3b12a.html
The difference between a character stream and a byte stream is (C)
A) Each read in a different number of bytes B) The former has a buffer, the latter is not
C) The former is character read and write, the latter is byte read and write D) there is no difference, can be used interchangeably
25. For a description of the following application, it is correct (C)
1. Class Staticstuff
2. {
3. static int x=10;
4. static {x+=5;}
5 public static void Main (String args[])
6. {
7. System.out.println ("x=" + x);
8. }
9. static {x/=3;}
10.}
A, 4 lines, and 9 rows cannot be compiled because the method name and return type are missing
B, 9 rows cannot be compiled because there can be only one static initializer
C, compile the pass, the result of execution is: x=5
D, compile pass, execution result is: x=3
java-Selection Questions