Exam 4: Writing Classes

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

To define a class that will represent a car, which of the following definitions is most appropriate?

(Multiple Choice)
4.9/5
(34)

Instance data for a Java class

(Multiple Choice)
4.7/5
(44)

Having multiple class methods of the same name where each method has a different number of or type of parameters is known as

(Multiple Choice)
4.8/5
(39)

All Java classes must contain a main method which is the first method executed when the Java class is called upon.

(True/False)
4.8/5
(31)

An Employee will have a name, social security number, position, and hourly wages. Define the instance data for this class.

(Essay)
4.8/5
(46)

A method defined in a class can access the class' instance data without needing to pass them as parameters or declare them as local variables.

(True/False)
4.9/5
(33)

An object should be encapsulated in order to guard its data and methods from inappropriate access.

(True/False)
4.8/5
(38)

Regarding the software failure described at the Denver International Airport, it is critical to factor in errors and inefficiencies that always occur in a complex system.

(True/False)
4.9/5
(37)

What are the objects needed in order to create a Java GUI (graphical user interface)?

(Multiple Choice)
4.9/5
(39)

Assume method0 calls method1 and method2, method1 calls method3 which calls method4 and method5. Explain the chain of method calls (what order methods are called and from which method).

(Essay)
4.8/5
(36)

Consider a method defined with the header: public void doublefoo(double x). Which of the following method calls is legal?

(Multiple Choice)
4.9/5
(35)

What visibility modifiers would you use for the methods that move the elevator up one floor, move the elevator down one floor, that request the elevator, and that start the elevator moving?

(Essay)
4.9/5
(40)

Visibility modifiers include

(Multiple Choice)
4.8/5
(32)

Add a constructor to class Box for a cube, which has only 1 parameter, side.

(Essay)
4.9/5
(34)

StringTokenizer is a class in the java.util library that can divide a String based on some delimiter String (a delimiter is a separator). If the instruction StringTokener st = new StringTokenizer(str, "&&"); is executed, where str is some String, then st divides up str into separate Strings whenever

(Multiple Choice)
4.8/5
(37)

The interface of a class is based on those data instances and methods that are declared public.

(True/False)
5.0/5
(43)

In a UML diagram for a class

(Multiple Choice)
4.9/5
(30)

The software failure at the Denver International Airport's baggage handling system is a good example of

(Multiple Choice)
4.9/5
(37)

Which of the following reserved words in Java is used to create an instance of a class?

(Multiple Choice)
4.8/5
(42)

Write the statement to instantiate an Box object, blueBox, with a length of 6, width of 4, and height of 2.

(Short Answer)
4.7/5
(39)
Showing 21 - 40 of 56
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)