CS 1331 Exam 2 Terms with |!! |!! |!! |!! |!! |!!
answers
type - correct answer✔✔A class is a "____"
|!! |!! |!! |!! |!! |!! |!!
Data, methods - correct answer✔✔What are the two main attributes of a
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
class?
Instance data - correct answer✔✔Values that are within the class but not
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
within the methods |!! |!!
copy - correct answer✔✔Each object that gets instantiated for the class
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
gets its own ____ of the instance variables
|!! |!! |!! |!! |!! |!! |!!
Methods - correct answer✔✔functions/procedures (behaviors) within the
|!! |!! |!! |!! |!! |!! |!!
class
body - correct answer✔✔public double meth1 (int var1) {
|!! |!! |!! |!! |!! |!! |!! |!!
|!! double var2; |!! |!!
|!! var2 = var1 * 3.2; //what are the contents of a method called?
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
|!! return var2; |!!
}
Return statement - correct answer✔✔control immediately goes back to call
|!! |!! |!! |!! |!! |!! |!! |!! |!!
return; - correct answer✔✔What is the return statement for a void
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
method?
, Local variables - correct answer✔✔Variables delcared inside a method, and
|!! |!! |!! |!! |!! |!! |!! |!! |!!
only in that method
|!! |!! |!! |!!
Parameters - correct answer✔✔Variables passed into a method |!! |!! |!! |!! |!! |!! |!!
Formal paramaters - correct answer✔✔Names of the parameters in the
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
header declaration |!!
Actual paramaters - correct answer✔✔Values passed in when running
|!! |!! |!! |!! |!! |!! |!! |!!
T - correct answer✔✔(T/F) Arrays can be parameters
|!! |!! |!! |!! |!! |!! |!!
Static methods - correct answer✔✔Methods that are not called in the
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
context of an object. |!! |!! |!!
Non-static methods - correct answer✔✔Methods that are always called in |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
the context of an object
|!! |!! |!! |!!
this - correct answer✔✔A Java reserved word that is used inside methods.
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
It refers to the objectupon which the method was invoked.
|!! |!! |!! |!! |!! |!! |!! |!! |!!
Class interface - correct answer✔✔Specified certain methods for outsiders
|!! |!! |!! |!! |!! |!! |!! |!! |!!
to use |!!
Visibility modifiers - correct answer✔✔Modifiers that control access
|!! |!! |!! |!! |!! |!! |!!
public - correct answer✔✔Modifier that allows anyone to access instance
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
data and methods |!! |!!
answers
type - correct answer✔✔A class is a "____"
|!! |!! |!! |!! |!! |!! |!!
Data, methods - correct answer✔✔What are the two main attributes of a
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
class?
Instance data - correct answer✔✔Values that are within the class but not
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
within the methods |!! |!!
copy - correct answer✔✔Each object that gets instantiated for the class
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
gets its own ____ of the instance variables
|!! |!! |!! |!! |!! |!! |!!
Methods - correct answer✔✔functions/procedures (behaviors) within the
|!! |!! |!! |!! |!! |!! |!!
class
body - correct answer✔✔public double meth1 (int var1) {
|!! |!! |!! |!! |!! |!! |!! |!!
|!! double var2; |!! |!!
|!! var2 = var1 * 3.2; //what are the contents of a method called?
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
|!! return var2; |!!
}
Return statement - correct answer✔✔control immediately goes back to call
|!! |!! |!! |!! |!! |!! |!! |!! |!!
return; - correct answer✔✔What is the return statement for a void
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
method?
, Local variables - correct answer✔✔Variables delcared inside a method, and
|!! |!! |!! |!! |!! |!! |!! |!! |!!
only in that method
|!! |!! |!! |!!
Parameters - correct answer✔✔Variables passed into a method |!! |!! |!! |!! |!! |!! |!!
Formal paramaters - correct answer✔✔Names of the parameters in the
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
header declaration |!!
Actual paramaters - correct answer✔✔Values passed in when running
|!! |!! |!! |!! |!! |!! |!! |!!
T - correct answer✔✔(T/F) Arrays can be parameters
|!! |!! |!! |!! |!! |!! |!!
Static methods - correct answer✔✔Methods that are not called in the
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
context of an object. |!! |!! |!!
Non-static methods - correct answer✔✔Methods that are always called in |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
the context of an object
|!! |!! |!! |!!
this - correct answer✔✔A Java reserved word that is used inside methods.
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
It refers to the objectupon which the method was invoked.
|!! |!! |!! |!! |!! |!! |!! |!! |!!
Class interface - correct answer✔✔Specified certain methods for outsiders
|!! |!! |!! |!! |!! |!! |!! |!! |!!
to use |!!
Visibility modifiers - correct answer✔✔Modifiers that control access
|!! |!! |!! |!! |!! |!! |!!
public - correct answer✔✔Modifier that allows anyone to access instance
|!! |!! |!! |!! |!! |!! |!! |!! |!! |!!
data and methods |!! |!!