Starting Out with Java Study Set 1

Computing

Quiz 8 :

A Second Look at Classes and Objects

Quiz 8 :

A Second Look at Classes and Objects

Question Type
search
arrow
When an object reference is passed to a method, the method may change the values in the object.
Free
True False
Answer:

Answer:

True

Tags
Choose question tag
close menu
arrow
An instance of a class does not have to exist in order for values to be stored in a class's static fields.
Free
True False
Answer:

Answer:

True

Tags
Choose question tag
close menu
arrow
__________ is the term for the relationship created by object aggregation.
Free
Multiple Choice
Answer:

Answer:

A

Tags
Choose question tag
close menu
arrow
Static methods can only operate on __________ fields.
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
An enumerated data type is actually a special type of class.
True False
Answer:
Tags
Choose question tag
close menu
arrow
The key word this is the name of a reference variable that an object can use to refer to itself.
True False
Answer:
Tags
Choose question tag
close menu
arrow
If you write a toString method for a class, Java will automatically call the method any time you concatenate an object of the class with a string.
True False
Answer:
Tags
Choose question tag
close menu
arrow
If a class has a method named finalize, it is called automatically just before a data member that has been identified as final of the class is destroyed by the garbage collector.
True False
Answer:
Tags
Choose question tag
close menu
arrow
enum constants have a toString method.
True False
Answer:
Tags
Choose question tag
close menu
arrow
If a class has a method named finalize, it is called automatically just before an instance of the class is destroyed by the garbage collector.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A single copy of a class's static field is shared by all instances of the class.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A class's static methods do not operate on the fields that belong to any instance of the class.
True False
Answer:
Tags
Choose question tag
close menu
arrow
The only limitation that static methods have is __________.
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
Both instance fields and instance methods are associated with a specific instance of a class, and they cannot be used until an instance of the class is created.
True False
Answer:
Tags
Choose question tag
close menu
arrow
The key word this is the name of a reference variable that is available to all static methods.
True False
Answer:
Tags
Choose question tag
close menu
arrow
The names of the enum constants in an enumerated data type must be enclosed in quotation marks.
True False
Answer:
Tags
Choose question tag
close menu
arrow
You can declare an enumerated data type inside a method.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A class that is defined inside another class is called a(n) __________.
Multiple Choice
Answer:
Tags
Choose question tag
close menu
arrow
When an object is passed as an argument, it is actually a reference to the object that is passed.
True False
Answer:
Tags
Choose question tag
close menu
arrow
If you write a toString method to display the contents of an object, object1, for a class, Class1, then the following two statements are equivalent: System.out.println(object1); System.out.println(object1.toString());
True False
Answer:
Tags
Choose question tag
close menu
Showing 1 - 20 of 52