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

1) An object\'s properties are also known as what? 2) What is another name for a

ID: 3826631 • Letter: 1

Question

1) An object's properties are also known as what?

2) What is another name for an object?

3) Which of the following statements is FALSE?

4) Which of the following things does this statement do?
Color darkBrown = new Color( 120, 160, 0 );

5) An object diagram represents what?

6) When drawing an object diagram, you evaluate a series of program statements to figure out how they change the contents of memory. Which of the following is a question you should ask as you evaluate each line of code?

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

8) Which of the following valid statements creates (constructs) an object? [Read very carefully!]
/* 1 */ Oval dot = new Oval();
/* 2 */ dot.setColor( new Color( 0, 0, 255 ) );
/* 3 */ dot.setFilled();
/* 4 */ Oval circle;
/* 5 */ circle = dot;

a) methods

Explanation / Answer

Ans1) An object's properties are also known as "instance variables".

Ans2) "An instance of a class" is another name for an object.

Ans3) "A public attribute may be examined from anywhere in the program, but may not be changed" is false statement.

Ans4) Color darkBrown = new Color( 120, 160, 0 ); constructs a new object.

Ans5) An object diagram represents "the collection of all possible objects".

Ans6) "Does the line of code instantiate an object?" is a question I will ask as I evaluate each line of code when drawing an object diagram,

Ans7) "None of the above" statements declares a variable.

Ans8) "/* 1 */ Oval dot = new Oval();" and "/* 1 */ Oval dot = new Oval();" are valid statements that creates (constructs) an object.

i.e b is the correct option.