Sample Test Questions
1) Define list, declaration, signature, instance, class, object,
Abstract Data Type (ADT), source code file, interface, megabyte, gigabyte,
terabyte, petabyte, yottabyte, zettabyte, method, attribute,
data member, static class method
2) What is the difference between an accessor method and a mutator method
of a class?
3) Describe what method(s) is/are implemented for the Comparable
4. Create a class called Student to hold a student id(integer),
a student name (string), a gpa (double), and credit hours (integer).
Write a default constructor, 2 accessors, 2 mutators, and the private
data members that would most likely be needed.
Make the class
implement the Comparable interface.
Be sure to provide the toString() method.
5) USING your class Student, write a main method that does each
of the following.
i) create a Student, s3, with id-700 name-Joe gpa-3.5 hours-100
ii) create a Student, s2
with id-800 name-Mary gpa-3.25 hours-30
iii) print both s3 and s2 to the screen.
iv) Change s3's name to Joe Galloway.