Term
A class describes how data and methods are encapsulated into a single object. |
|
Definition
|
|
Term
From one object you can build many classes |
|
Definition
False, from one class you can build many objects |
|
|
Term
From one class you can build many objects |
|
Definition
|
|
Term
Every object belongs to some class |
|
Definition
|
|
Term
Every class belongs to some object |
|
Definition
False, every object belongs to some class |
|
|
Term
Different objects of the same class share the same methods |
|
Definition
|
|
Term
Different objects of the same class always share the same data |
|
Definition
False, each objects has their own data |
|
|
Term
An object belongs to more than one class |
|
Definition
|
|
Term
A method cannot return a reference to an object |
|
Definition
False, method can return a reference |
|
|
Term
The name of an object specifies a reference |
|
Definition
|
|
Term
When an object is passed to a method, the objects data is copied into a method parameter |
|
Definition
|
|
Term
Java provides a class that facilatates the formatting of floating numbers |
|
Definition
|
|
Term
Java does not allow a programmer to write their own classes |
|
Definition
False you can write as many as you want |
|
|
Term
A private method of a class is accessible to every method of the class |
|
Definition
|
|
Term
A public instance variable is accessible to every method in the class |
|
Definition
|
|
Term
A private instance variable is accessible to any method external to the class |
|
Definition
False, because it is private |
|
|
Term
A static variable is shared by all objects of a class |
|
Definition
|
|
Term
A static variable x can be accessed by an object p the same way any instance variable is accessed namely p.x |
|
Definition
|
|
Term
A public static variable is accessible to any method external to the class |
|
Definition
|
|
Term
A public static variable is accessible to any method external to the class |
|
Definition
|
|
Term
A public static variable is accessible to any method external to the class |
|
Definition
|
|
Term
A private static variable is accessible to any method external to the class |
|
Definition
|
|
Term
A constructor is a special kind of method with no return type, not even void |
|
Definition
|
|
Term
Constructors intialize and instantiate objects |
|
Definition
|
|
Term
Only one constructor per class is permitted |
|
Definition
False , you can have muiltple |
|
|
Term
Constructors cannot be overloaded |
|
Definition
|
|
Term
If you fail to define a constructor, java provides a default constructor and correctly initialize instance varialbe |
|
Definition
|
|
Term
an object is garbage when it is no longer referenced |
|
Definition
|
|
Term
key word THIS is a reference to the calling object |
|
Definition
|
|
Term
keyword THIS is a allows a method to refer directly to the referece of the called object |
|
Definition
|
|
Term
An instance variable must be built-in Java type and not a programmer designed class |
|
Definition
|
|
Term
Correct:
String howAboutThat = new String('a') |
|
Definition
'a' is a char not a string to correct "a" |
|
|
Term
Correct:
String String = " String" ; |
|
Definition
String string = " String " ; |
|
|
Term
Correct:
Random randomNum = 3; |
|
Definition
Random randomNum = new Random (3); |
|
|
Term
Correct
Random x = Random (); |
|
Definition
|
|
Term
Correct:
Random y = new Random (3); |
|
Definition
|
|
Term
Correct
import Java.util; |
|
Definition
|
|
Term
Correct:
File MyFile = new File(); |
|
Definition
String x = "myfile.txt";
File MyFile= new File(x); |
|
|
Term
File f = new File(myfile.txt);
|
|
Definition
File f = new File ( " myfile.txt") ; |
|
|
Term
String text = "myfile.txt";
File myFile = new File ("text"); |
|
Definition
String text = "myfile.txt";File myFile = new File ( text); |
|
|
Term
String y = " testme"; y +=char(33) |
|
Definition
String y = " testme";
y +=(char)33 |
|
|
Term
String w = "Why me?";
int temp = w.trim.length(); |
|
Definition
String w = "Why Me?";
int temp = w.trim().length(); |
|
|