A class is defined as a blueprint for an object and does not contain __.
A) properties or data
B) constructs
C) behavior or actions
D) a main method
A) properties or data
B) constructs
C) behavior or actions
D) a main method
D) a main method
If Triangle is defined as an object, which of the following statements declare, create and assign an object reference to the variable myTriangle?
A) Triangle myTriangle;
B) myTriangle = new Triangle( );
C) Triangle myTriangle = new Triangle( );
D) New Triangle( ):
A) Triangle myTriangle;
B) myTriangle = new Triangle( );
C) Triangle myTriangle = new Triangle( );
D) New Triangle( ):
C) Triangle myTriangle = new Triangle( );
When a variable of reference type is declared, the variable holds a special Java value, insertanswer,which means that the variable does not reference any object.
null
A data field that is defined in an object is referred to as an instance variable because it is insert answer a specific instance.
tied to
You can create an object without explicitly assigning it to a variable. An object created in this way is known as a(n) insert answer.
anonymous object
Which of the following statements is not true about a constructor of an object?
a. There can be multiple constructors in a class
b. If there is no constructor defined in a class, the system will generate a default constructor.
c. There can be one and only one constructor in a class
d. All of the above statements are true.
a. There can be multiple constructors in a class
b. If there is no constructor defined in a class, the system will generate a default constructor.
c. There can be one and only one constructor in a class
d. All of the above statements are true.
c. There can be one and only one constructor in a class
A method that regulates access to internal private data fields is called a(n) _.
accessor or setter method.
Like passing arrays, passing objects is actually passing the _ of the object.
reference
The scope of a class variable is ___ .
The entire class regardless of where the variable is declared.
After an object is created, its data can be accessed and its methods invoked using the comma operator.
A) True
B) False
A) True
B) False
B) False
Java enables you to define a special method in the class, known as the contractor that can be used to initialize an object’s data.
A) True
B) False
A) True
B) False
B) False
Kartensatzinfo:
Autor: somgaet
Oberthema: Informatik
Thema: Java
Veröffentlicht: 26.04.2010
Schlagwörter Karten:
Alle Karten (17)
keine Schlagwörter