Question 1
An object's properties are also known as what?
Flag this Question
Question 2
What is another name for an object?
Flag this Question
Question 3
Which of the following is the name of an instance variable in the CSC142Point class provided in this week's samples?
Flag this Question
Question 4
How many constructors are defined in the CSC142Point class provided in this week's examples?
Flag this Question
Question 5
Which of the following is the name of a query method in the CSC142Point class in this week's examples?
Flag this Question
Question 6
Which of the following is the name of a mutator (update) method in the CSC142Point class in this week's examples?
Flag this Question
Question 7
Which method in the CSC142Point class returns a reference to a new CSC142Point object?
Flag this Question
Question 8
Which of the following statements is FALSE?
| A private method may be called from anywhere within the class in which it is declared. |
| A public attribute may be examined from anywhere in the program, but may not be changed. |
| The keyword void indicates that a method does not return any value. |
Flag this Question
Question 9
Which of the following things does this statement do? Color darkBrown = new Color( 120, 160, 0 );
Flag this Question
Question 10
An object diagram represents what?
| the state of memory at a particular point during the execution of a program |
| the collection of all possible objects |
| the same thing as a flowchart |
Flag this Question
Question 11
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?
| Does the line of code declare a variable? |
| Does the line of code instantiate an object? |
| Does the line of code create a binding? |
Flag this Question
Question 12
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;
Flag this Question
Question 13
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;
Flag this Question
Question 14
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;
Flag this Question
Question 15
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;
Flag this Question
Question 16
What is an orphaned object?
| an object with no methods |
| an object which has no references to it |
| a temporary variable bound to an object |
Flag this Question
Question 17
What are the different views of a class?
- Source code
- UML Class Diagram
- Javadoc comments
Flag this Question
Question 18
What does the keyword 'this' refer to when used in a statement in code?
| the program in which the statement exists |
| the class in which the statement is located |
| the particular object executing the statement |
| the method in which the statement is located |
Flag this Question
Question 19
Which of the following is the name of the client class; in this code?
public class Marge { public Crayon favorite() { Crayon fav = new Crayon(); return fav; } }
Flag this Question
Question 20
Which is an access modifier?