subclass a inherits the parent Class B, a A = new A (), the parent Class B constructor, the parent class B static code block, the parent class B non-static code block, the subclass a constructor, the subclass a static code block, the subclass a non-static code block execution order is?
A; parent class B static code block, parent Class B constructor, subclass a static code block, parent class B non-static code block, subclass a constructor, subclass a non-static code block
B: Parent class B Static code block, parent Class B constructor, parent class B non-static code block, subclass a static code block, subclass a constructor, subclass a non-static code block
C; parent Class B static code block, subclass a static code block, parent class B non-static code block, parent Class B constructor, subclass a non-static code block, sub-Class A constructor
D; parent Class B constructor, parent class B static code block, parent class B non-static code block, subclass a static code block, subclass a constructor, subclass a non-static code block
Answer: C.
In class design, the member variables of a class are required to be accessed only by classes under the same package, which of the following modifiers should be used ()
a;protected
B;public
C:private
D: no modifiers required
Analytical:
The following is about the JVM memory, what is the wrong word?
A: The program counter is a small area of memory that indicates the byte code executed by the current thread executes to the first line, which is thread-isolated
The B:java method executes the memory model for storing local variables, operand stacks, dynamic links, method exits and other information, which is thread-isolated
C: The method area is used to store JVM-loaded class information, constants, static variables, and even data such as compiler-compiled code, which are thread-isolated
D: In principle, all objects allocate memory on the heap, which is shared between threads
Answer: C
Analytical:
String str = "Hello world" in Java the following statement is wrong?
a:str+= ' a '
B:int strlen = str.length
c:str=100
d:str=str+100
Analytical:
Analytical:
Wrong question 0913