Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1, You can assign ________ to a variable of Object[] type. new char[100] new int

ID: 3909151 • Letter: 1

Question

1, You can assign ________ to a variable of Object[] type.

new char[100]

new int[100]

new double[100]

new String[100]

new java.util.Date[100]

2, Every object is an instance of the Object class.

true

false

3, Given the following classes and their objects:

class C1 {};
class C2 extends C1 {};
class C3 extends C1 {};

C2 c2 = new C2();
C3 c3 = new C3();

Analyze the following statement:

c2 = (C2)((C1)c3);

c3 is cast into c2 successfully.

You will get a runtime error because you cannot cast objects from sibling classes.

You will get a runtime error because the Java runtime system cannot perform multiple casting in nested form.

The statement is correct.

4, The UML uses ________ before a member name to indicate that the member is private.

+

-

#

?

Explanation / Answer

1. new String[100] 2. true 3. You will get a runtime error because you cannot cast objects from sibling classes. 4. -