Java Programming

Computing

Quiz 8 :

User-Defined Classes and Adts

Quiz 8 :

User-Defined Classes and Adts

Question Type
search
arrow
An accessor method of a class first accesses the values of the data members of the class and then changes the values of the data members.
Free
True False
Answer:

Answer:

False

Tags
Choose question tag
close menu
arrow
In deep copying, each reference variable refers to its own object.
Free
True False
Answer:

Answer:

True

Tags
Choose question tag
close menu
arrow
Given the declaration public class MyClass {private int x; public void print() {System.out.println("x = " + x);} private void setX(int y) {x = y;}} MyClass myObject = new MyClass(); The following statement is legal. myObject.print();
Free
True False
Answer:

Answer:

True

Tags
Choose question tag
close menu
arrow
When no object of the class type is instantiated, static data members of the class fail to exist.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Members of a class are usually classified into three categories: public, private, and static.
True False
Answer:
Tags
Choose question tag
close menu
arrow
If the object is created in the definition of a method of the class, then the object can access both the public and private members of the class.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Not every user-defined class can override the default definition of the method toString because it is provided by Java.
True False
Answer:
Tags
Choose question tag
close menu
arrow
The components of a class are called fields.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Constructors are called like any other method.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Modifiers are used to alter the behavior of the class.
True False
Answer:
Tags
Choose question tag
close menu
arrow
The methods of a class must be public.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A constructor has no type and is therefore a void method.
True False
Answer:
Tags
Choose question tag
close menu
arrow
If a member of a class is a private method, you can access it outside the class.
True False
Answer:
Tags
Choose question tag
close menu
arrow
In shallow copying, each reference variable refers to its own object.
True False
Answer:
Tags
Choose question tag
close menu
arrow
Given the declaration public class MyClass {private int x; public void print() {System.out.println("x = " + x);} private void setX(int y) {x = y;}} MyClass myObject = new MyClass(); The following statement is legal. myObject.setX(10);
True False
Answer:
Tags
Choose question tag
close menu
arrow
The built-in operation that is valid for classes is the dot operator.
True False
Answer:
Tags
Choose question tag
close menu
arrow
The non-static methods of a class are called instance methods.
True False
Answer:
Tags
Choose question tag
close menu
arrow
The default constructor executes when an object is instantiated and initialized using an existing object.
True False
Answer:
Tags
Choose question tag
close menu
arrow
The method finalize automatically executes when the class object goes out of scope.
True False
Answer:
Tags
Choose question tag
close menu
arrow
A class and its members can be described graphically using Unified Modeling Language (UML) notation.
True False
Answer:
Tags
Choose question tag
close menu
Showing 1 - 20 of 50