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

1) Which of the following valid statements creates a binding (assigns a value to

ID: 3826639 • Letter: 1

Question

1) Which of the following valid statements creates a binding (assigns a value to a variable)?
/* 1 */ Oval dot = new Oval();
/* 2 */ dot.setColor( new Color( 0, 0, 255 ) );
/* 3 */ dot.setFilled();
/* 4 */ Oval circle;
/* 5 */ circle = dot;

2) Which of the following valid statements creates an alias?
/* 1 */ Oval dot = new Oval();
/* 2 */ dot.setColor( new Color( 0, 0, 255 ) );
/* 3 */ dot.setFilled();
/* 4 */ Oval circle;
/* 5 */ circle = dot;

3) What is an orphan?

4) What are the different views of a class?

I. Source code

II. UML Class Diagram

III. Javadoc comments

5) What does the keyword 'this' refer to when used in a statement in code?

6) Which of the following is the name of the client class; in this code?

7) Which is an access modifier?

a) 1

Explanation / Answer

1) C
2) E, In circle=dot; you are only making an reference of the dot object in the circle variable.
3) B, An object which has no references to it is an orphan. I can removed in garbage collection.
4) B
5) C, this refers to the particular object.
6) C, The class name is Marge.
7) A, public, private are access modifiers.