题目内容

What constructor is equivalent to the one listed here public SampleConstructor( { System.out.println("SampleConstructor"); }

A. public SampleConstructor() { this(); System.out.println("Sample Constructor"); }
B. public SampleConstructor() { super(); System.out.println("Sample Constructor"); }
C. public SampleConstructor() { this.SampleConstructor(); System.out.println("Sample Constructor"); }
D. public SampleConstructor() { super.SampleConstructor(); System.out.println("Sample Constructor"); }
E. None of the above

查看答案
更多问题

What best describes the result of the following code segment The ArrayList sampleArrayList has already been declared and initialized. int i = 63; sampleArrayList.add(i);

A. The int is successfully placed into the ArrayList.
B. The int is converted to an Integer via autoboxing and then placed into the ArrayList.
C. null is placed into the ArrayList.
D. A compile time error will be generated.
E. A runtime exception will be thrown.

在坚持开放、合作、利用和借鉴的同时,必须保持头脑清醒,始终坚持将( )放在首要地位。

A. 社会主义的价值观念
B. 马列主义的意识形态
C. 国家的主权和安全
D. 民族的传统和利益

Given the SampleClass, what is the output of this code segment SampleClass sampleClass = new SampleClass(); public class SampleClass { private int size; private int priority; public SampleClass() { super(); System.out.println("Using default values"); } public SampleClass(int size) { this.size = size; System.out.println("Setting size"); } public SampleClass(int priority) { this.priority = priority; System.out.println("Setting priority"); } }

A. Using default values
B. Setting size
C. Setting priority
D. Compiler error

Objects are passed by ______.

A. Value
B. Sum
C. Reference
D. Pointer

答案查题题库