CPT - 236 Intro to JAVA Programming
Test 2 study Guide Solved Exam
Questions and Answers (Complete
Practice Papers)
Which of the following method calls is the correct call to a
method coolMethod that expects two parameters; a boolean
and an integer - Correct Answers ✅coolMethod(true,
"string")
coolMethod(2, 2)
coolMethod(true, 1) CORRECT
coolMethod(false, 5.0)
Which of the following is used to initialize member variables
when an object is created - Correct Answers ✅constructor
CORRECT
destructor
initialization program
initialization method
The output of the following program is public class Test {
public static void main ( String[] args ) {
String myString = "A class about strings";
String myString2= myString.substring( 0 ,13) +"main";
System.out.print( myString2 );
}
} - Correct Answers ✅A class about strings
, CPT - 236 Intro to JAVA Programming
Test 2 study Guide Solved Exam
Questions and Answers (Complete
Practice Papers)
A class about main CORRECT
A class main
A aboutmain
When a called method has parameters / expecting data, the
call to the method should have arguments that match the
called method's parameters in number, order and _________ -
Correct Answers ✅type CORRECT
sequence
hierarchy
value
Inside the Account class, Account( ) is _____
public class Account {
public Account( ) { balance = 0.0 } . . . . . .
} - Correct Answers ✅constructor CORRECT
expression
variable
parent
The output of the following program is ___
public class Test {
Test 2 study Guide Solved Exam
Questions and Answers (Complete
Practice Papers)
Which of the following method calls is the correct call to a
method coolMethod that expects two parameters; a boolean
and an integer - Correct Answers ✅coolMethod(true,
"string")
coolMethod(2, 2)
coolMethod(true, 1) CORRECT
coolMethod(false, 5.0)
Which of the following is used to initialize member variables
when an object is created - Correct Answers ✅constructor
CORRECT
destructor
initialization program
initialization method
The output of the following program is public class Test {
public static void main ( String[] args ) {
String myString = "A class about strings";
String myString2= myString.substring( 0 ,13) +"main";
System.out.print( myString2 );
}
} - Correct Answers ✅A class about strings
, CPT - 236 Intro to JAVA Programming
Test 2 study Guide Solved Exam
Questions and Answers (Complete
Practice Papers)
A class about main CORRECT
A class main
A aboutmain
When a called method has parameters / expecting data, the
call to the method should have arguments that match the
called method's parameters in number, order and _________ -
Correct Answers ✅type CORRECT
sequence
hierarchy
value
Inside the Account class, Account( ) is _____
public class Account {
public Account( ) { balance = 0.0 } . . . . . .
} - Correct Answers ✅constructor CORRECT
expression
variable
parent
The output of the following program is ___
public class Test {