A class specifies the ________ and ________ that a particular type of object has. |
fields; methods |
A constructor is a method that: |
Performs initialization or setup operations. |
A constructor: |
Has the same name as the class. |
After the header, the body of the method appears inside a set of: |
braces, {} |
Another term for an object of a class is: |
instance |
Class objects normally have ________ that perform useful operations on their data, but primitive variables do not. |
methods |
For the following code, which statement is not true? |
y is available to code that is written outside the Circle class. |
It is common practice in object-oriented programming to make all of a class’s: |
Fields private. |
Java allows you to create objects of this class in the same way you would create primitive variables. |
String |
Most programming languages that are in use today are: |
Object-oriented. |
One or more objects may be created from a(n): |
class |
Overloading means multiple methods in the same class: |
Have the same name, but different parameter lists. |
Quite often you have to use this statement to make a group of classes available to a program. |
import |
The scope of a private instance field is: |
The instance methods of the same class. |
This is a group of related classes. |
Package |
This refers to the combining of data and code into a single object. |
Encapsulation |
Two or more methods in a class may have the same name as long as: |
They have different parameter lists. |
What is stored by a reference variable? |
A memory address |
When an object is passed as an argument to a method, what is passed into the method’s parameter variable? |
The object’s memory address |
Which of the following statements will create a reference, str, to the string, "Hello, world"? (1) String str = new String("Hello, world"); |
1 and 2 |
COSC 6
Share This
Unfinished tasks keep piling up?
Let us complete them for you. Quickly and professionally.
Check Price