Wrong question 0913

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.