

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Exam; Class: Computer Science II; Subject: Computer Science; University: North Georgia College & State University; Term: Summer 2002;
Typology: Exams
1 / 3
This page cannot be seen from the preview
Don't miss anything!
North Georgia College & State University Department of Mathematics & Computer Science CSCI 1302, Computer Science I Summer 2002 7/10/ Test2, 150 points, each question worth 10 point Name________ Seat Numbers_____ MULTIPLE CHOICE (Circle one only)
1. Which of the following is correct in Java a. Every class that does not specifically extend another class is a subclass of the class Object b. When you declare a class you must specifically extend it from class Object c. The class Object has no methods of its own d. The class Object has no subclass 2. Select the incorrect answer about interface a. An interface is not a class b. An interface has no state and no behavior c. An interface tells you which method you should implement d. An interface is a class 3. Which of the following is incorrect about inheritance a. Inheritance adds additional complexity to a java program b. Inheritance allows reuse of code c. We can inherit from exiting Java classes and create user defined classes d. To declare inheritance we use the word extends 4. Select the incorrect answer about inheritance a. You can override methods from the superclass b. You can only inherit instance variables from the superclass c. You can inherit methods from the superclass d. You can define new methods in the subclass. 5. Select the incorrect answer about inheritance a. You can override instance variables from the superclass b. You can inherit methods from the superclass c. You can inherit instance variables from the superclass d. You can define new fields in the subclass. 6. Assume deposit () is a method of the super class BankAccount. Which of the following is correct. a. public class CheckingAccount extends BankAccount { public void deposit(double amount); { deposit(super.amount); ... } }
b. public class CheckingAccount extends BankAccount { public void deposit(double amount); { super.deposit(amount);
... } } c. public class CheckingAccount extends BankAccount { public void deposit(double amount); { super(deposit(amount)); ... } } d. public class CheckingAccount extends BankAccount { public void deposit(double amount); { deposit(super(amount)); ... } }