Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Test 2 Questions - Computer Science II | CSCI 1302, Exams of Computer Science

Material Type: Exam; Class: Computer Science II; Subject: Computer Science; University: North Georgia College & State University; Term: Summer 2002;

Typology: Exams

Pre 2010

Uploaded on 08/04/2009

koofers-user-okt
koofers-user-okt 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
North Georgia College & State University
Department of Mathematics & Computer Science
CSCI 1302, Computer Science I
Summer 2002 7/10/02
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);
. . .
}
}
1
pf3

Partial preview of the text

Download Test 2 Questions - Computer Science II | CSCI 1302 and more Exams Computer Science in PDF only on Docsity!

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)); ... } }

  1. Which of the following is no t an example of GUI component a. A JButton object b. A JLabel object c. A JtextField object d. A Recatngle object
  2. Select the correct statement a. Method calls are determined by the type of the object reference b. Method calls are determined by the type of the actual object c. Method calls are determined by both the actual object and reference to the object d. Method calls are independent of the object and reference to the object FILL IN THE BLANKS
  3. If the class Alpha inherits from the class Beta, class Alpha is called the _______ class and class Beta is called the ______class.
  4. Inheritance enables ________, which saves time in development and encourages using previously proven and high-quality software components TRUE/FALSE
  5. A JPanel cannot be added to another JPanel.
  6. BorderLayout is the default layout manager for a content pane