Exam 2: Using Objects

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

Which of the following statements about test programs is true?

(Multiple Choice)
4.7/5
(36)

In the code below, write a statement that sets the graphic to green. public class ItalianFlagComponent extends JComponent { Public void paintComponent(GraphicsG) { Graphics2D g2 = (Graphics2D) g; Rectangle.Double leftRectangle = new Rectangle.Double(100, 100, 30, 60); ) . . ____ ) . . } }

(Multiple Choice)
4.8/5
(38)

Which of the following terms denotes the memory location of an object?

(Multiple Choice)
4.8/5
(33)

What is the output of the following code: Int num1 = 6; Int num2 = num1; Num2 = num2 + 10; System.out.println(num1);

(Multiple Choice)
4.9/5
(33)

The object on which the method call is invoked provides input to the method, and is called a(n) _________________.

(Multiple Choice)
4.9/5
(35)

By convention, classes begin with a(n) _____________.

(Multiple Choice)
4.8/5
(34)

Which of the following represents a method call to a method with a void return type?

(Multiple Choice)
4.8/5
(32)

Which of the following statements about objects is correct?

(Multiple Choice)
4.8/5
(48)

Assume that the variable count has been declared as type int. Which statement adds 10 to count?

(Multiple Choice)
4.8/5
(45)

Which of the following declares a variable that will store a measurement with fractional parts?

(Multiple Choice)
4.9/5
(46)

Which method call represents the invocation of a method that does not have explicit parameters?

(Multiple Choice)
4.7/5
(42)

If greeting refers to a String object, which of the following is a syntactically correct Java statement?

(Multiple Choice)
5.0/5
(45)

Assuming the following Java statement: Circle c1 = new Circle(3); What does the variable c1 store?

(Multiple Choice)
4.8/5
(34)

Which operator constructs object instances?

(Multiple Choice)
4.7/5
(29)

A method name is ____________________ if a class has more than one method with that name (but different parameter types).

(Multiple Choice)
4.9/5
(31)

What is a storage location in the computer's memory called that has a type, name, and contents?

(Multiple Choice)
4.8/5
(40)

Assume that the variable count has been declared as type int, which statement changes the value of count?

(Multiple Choice)
4.9/5
(37)

Which of the following code fragments will cause an error?

(Multiple Choice)
5.0/5
(34)

Which term is used to describe the name of a variable, method, or class?

(Multiple Choice)
4.9/5
(34)

What is an object?

(Multiple Choice)
4.8/5
(36)
Showing 21 - 40 of 76
close modal

Filters

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