1) An object's properties are also known as what?
2) What is another name for an object?
d) | an instance of a class |
3) Which of the following statements is FALSE?
| a) A private method may be called from anywhere within the class in which it is declared. |
b) | A public attribute may be examined from anywhere in the program, but may not be changed. |
c) | The keyword void indicates that a method does not return any value. |
4) Which of the following things does this statement do? Color darkBrown = new Color( 120, 160, 0 );
| a) declare a new variable |
| b) construct a new object |
5) An object diagram represents what?
b) | the state of memory at a particular point during the execution of a program |
c) | the collection of all possible objects |
| d)the same thing as a flowchart |
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? a) | Does the line of code declare a variable? | b) | Does the line of code instantiate an object? | c) | Does the line of code create a binding? | | |
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;