Podcast
Questions and Answers
The GradeBook constructor is used to specify the course name at the time each GradeBook object is created.
The GradeBook constructor is used to specify the course name at the time each GradeBook object is created.
True
In the GradeBookTest class, 'gradeBook1' was created with the course name 'CS102 Data Structures in Java'.
In the GradeBookTest class, 'gradeBook1' was created with the course name 'CS102 Data Structures in Java'.
False
The displayMessage method in the GradeBook class will print a welcome message with the course name.
The displayMessage method in the GradeBook class will print a welcome message with the course name.
True
In GradeBookTest main method, gradeBook2's course name is displayed before gradeBook1's course name.
In GradeBookTest main method, gradeBook2's course name is displayed before gradeBook1's course name.
Signup and view all the answers
The GradeBookTest class contains the main method that begins the program execution.
The GradeBookTest class contains the main method that begins the program execution.
Signup and view all the answers
The GradeBook class does not have a method to retrieve the course name.
The GradeBook class does not have a method to retrieve the course name.
Signup and view all the answers
In the Java program, the initial value of the course name is null.
In the Java program, the initial value of the course name is null.
Signup and view all the answers
The GradeBook object is created using the 'new' keyword in the program.
The GradeBook object is created using the 'new' keyword in the program.
Signup and view all the answers
The program prompts the user to enter the course name using a Scanner object.
The program prompts the user to enter the course name using a Scanner object.
Signup and view all the answers
The setCourseName method is used to set the course name in the GradeBook object.
The setCourseName method is used to set the course name in the GradeBook object.
Signup and view all the answers
The displayMessage method is called after setting the course name.
The displayMessage method is called after setting the course name.
Signup and view all the answers
The program imports a package named 'java.util.Scanner'.
The program imports a package named 'java.util.Scanner'.
Signup and view all the answers
In the GradeBook class, the courseName instance variable is declared as 'private'.
In the GradeBook class, the courseName instance variable is declared as 'private'.
Signup and view all the answers
The method 'setCourseName' in the GradeBook class returns a value of type 'String'.
The method 'setCourseName' in the GradeBook class returns a value of type 'String'.
Signup and view all the answers
The 'displayMessage' method in the GradeBook class calls the 'getCourseName' method to get the name of the course.
The 'displayMessage' method in the GradeBook class calls the 'getCourseName' method to get the name of the course.
Signup and view all the answers
In GradeBook.java, 'public' keyword is used for most instance variables.
In GradeBook.java, 'public' keyword is used for most instance variables.
Signup and view all the answers
Encapsulation is achieved by declaring instance variables in the GradeBook class as public.
Encapsulation is achieved by declaring instance variables in the GradeBook class as public.
Signup and view all the answers
The return type in a method declaration indicates the item passed to that method.
The return type in a method declaration indicates the item passed to that method.
Signup and view all the answers