18 Questions
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'.
False
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.
False
The GradeBookTest class contains the main method that begins the program execution.
True
The GradeBook class does not have a method to retrieve the course name.
False
In the Java program, the initial value of the course name is null.
True
The GradeBook object is created using the 'new' keyword in the program.
True
The program prompts the user to enter the course name using a Scanner object.
True
The setCourseName method is used to set the course name in the GradeBook object.
True
The displayMessage method is called after setting the course name.
True
The program imports a package named 'java.util.Scanner'.
False
In the GradeBook class, the courseName instance variable is declared as 'private'.
True
The method 'setCourseName' in the GradeBook class returns a value of type 'String'.
False
The 'displayMessage' method in the GradeBook class calls the 'getCourseName' method to get the name of the course.
True
In GradeBook.java, 'public' keyword is used for most instance variables.
False
Encapsulation is achieved by declaring instance variables in the GradeBook class as public.
False
The return type in a method declaration indicates the item passed to that method.
False
Test your knowledge of the GradeBook Java program by identifying the purpose of specific methods and understanding the flow of the code. This quiz focuses on method functionality, method calls, and basic Java syntax.
Make Your Own Quizzes and Flashcards
Convert your notes into interactive study material.
Get started for free