Podcast
Questions and Answers
In the GradeBookTest.java program, the initial value of courseName is 'null'.
In the GradeBookTest.java program, the initial value of courseName is 'null'.
True (A)
The GradeBookTest.java program uses a Scanner object to obtain input from a file.
The GradeBookTest.java program uses a Scanner object to obtain input from a file.
False (B)
The setCourseName method is used to assign a value to the courseName variable in the GradeBook class.
The setCourseName method is used to assign a value to the courseName variable in the GradeBook class.
True (A)
The displayMessage method is called before setting the course name in the GradeBook object.
The displayMessage method is called before setting the course name in the GradeBook object.
The GradeBookTest.java program creates a GradeBook object called myGradeBook.
The GradeBookTest.java program creates a GradeBook object called myGradeBook.
The GradeBookTest.java program prompts the user to enter the course name after displaying the initial value of courseName.
The GradeBookTest.java program prompts the user to enter the course name after displaying the initial value of courseName.
The GradeBook class has a method called displayMessage that prints a welcome message along with the course name.
The GradeBook class has a method called displayMessage that prints a welcome message along with the course name.
In the GradeBookTest class, the main method is where GradeBook objects are created and initialized with course names.
In the GradeBookTest class, the main method is where GradeBook objects are created and initialized with course names.
The GradeBook constructor is called with a string argument to specify the course name for each GradeBook object created.
The GradeBook constructor is called with a string argument to specify the course name for each GradeBook object created.
In the GradeBookTest class, the getCourseName method is used to display the initial value of the courseName for each GradeBook object.
In the GradeBookTest class, the getCourseName method is used to display the initial value of the courseName for each GradeBook object.
The GradeBookTest class initializes multiple GradeBook objects with different course names using a loop statement.
The GradeBookTest class initializes multiple GradeBook objects with different course names using a loop statement.
The GradeBookTest class explicitly displays the course names of gradeBook1 and gradeBook2 after initializing them.
The GradeBookTest class explicitly displays the course names of gradeBook1 and gradeBook2 after initializing them.
The GradeBook class contains a method called setCourseName to retrieve the course name.
The GradeBook class contains a method called setCourseName to retrieve the course name.
Declaring instance variables as private is known as data hiding.
Declaring instance variables as private is known as data hiding.
Access Modifiers in Java are public, protected, and private.
Access Modifiers in Java are public, protected, and private.
The GradeBook class in the given text has a method named displayMessage that displays a welcome message along with the course name.
The GradeBook class in the given text has a method named displayMessage that displays a welcome message along with the course name.
The return type of a method indicates the value returned by the method and is declared in the method body.
The return type of a method indicates the value returned by the method and is declared in the method body.
GradeBook objects are constructed by setting the course name directly without using any methods.
GradeBook objects are constructed by setting the course name directly without using any methods.