Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 An object's properties are also known as what? methods instance variables orientations messages class variables Flag this Question Question 2 What is another

Question 1

An object's properties are also known as what?

methods
instance variables
orientations
messages
class variables

Flag this Question

Question 2

What is another name for an object?

a method
a variable
a data type
an instance of a class
a gadget

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?

private
double
x
xCoord
Point

Flag this Question

Question 4

How many constructors are defined in the CSC142Point class provided in this week's examples?

3
2
1
0

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?

Point
double
distance
diffX
public

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?

getX
setPoint
void
public
newX

Flag this Question

Question 7

Which method in the CSC142Point class returns a reference to a new CSC142Point object?

setX()
getX()
setPoint()
midPoint()
toString()

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 );

declare a new variable
construct a new object
create a binding
All of the above
None of the above

Flag this Question

Question 10

An object diagram represents what?

the makeup of a class
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?
All of the above
None of the above

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;

1
1 and 2
1 and 4
1, 4 and 5
None of the above

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;

1
1 and 2
1 and 4
1, 4 and 5
None of the above

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;

1
1 and 4
1 and 5
1, 2, 3 and 5
None of the above

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;

1
2
3
4
5

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
an object with no state

Flag this Question

Question 17

What are the different views of a class?

  1. Source code
  2. UML Class Diagram
  3. Javadoc comments
I
I & II
II & III
I, II, & III

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
None of the above

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; } }
public
Crayon
Marge
favorite
generateCrayon

Flag this Question

Question 20

Which is an access modifier?

public
new
this
String

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is the difference between microeconomics and macroeconomics?

Answered: 1 week ago