Exam 3: Using Classes and Objects

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

If you need to import not only the top-level of a package, but all its secondary levels as well, you should write: import package.*.*;

(True/False)
4.7/5
(47)

In Java a variable may contain

(Multiple Choice)
4.9/5
(37)

System.out.println("123" + 4) will display the value 127.

(True/False)
4.9/5
(30)

The printf method within System.out is designed to ease the conversion of legacy C code into Java.

(True/False)
4.8/5
(41)

Write the code to define the JFrame which will have the components placed into the JPanel first where the JPanel will have the inputLabel and ageField side by side and the outputLabel and messageLabel beneath them. Do not worry about making the JFrame do anything (i.e., don't implement an ActionListener).

(Essay)
5.0/5
(34)

Write a statement using a Scanner method to get the first name interactively.

(Short Answer)
4.8/5
(45)

Consider the following enumeration enum Speed { FAST, MEDIUM, SLOW };

(Multiple Choice)
4.7/5
(32)

The advantages of the DecimalFormat class compared with the NumberFormat class include

(Multiple Choice)
4.8/5
(33)

Only difficult programming problems require a pseudocode solution before the programmer creates the implementation (program) itself.

(True/False)
4.8/5
(33)

These two ways of setting up a string yield identical results: a) String string = new String("string"); b) String string = "string";

(True/False)
4.9/5
(38)

Consider the condition (x == y). How is this handled if x and y are primitive types? How is this handled if x and y are objects?

(Essay)
4.9/5
(43)

You may apply the prefix and postfix increment and decrement operators to instances of the Integer class.

(True/False)
4.7/5
(29)

The names of the wrapper classes are just the names of the primitive data types, but with an initial capital letter.

(True/False)
4.9/5
(40)

In addition to their usage providing a mechanism to convert (to box) primitive data into objects, what else do the wrapper classes provide?

(Multiple Choice)
4.9/5
(39)

What is a wrapper class? Why are they useful?

(Essay)
4.8/5
(31)

Given the following code fragment String strA = "aBcDeFg"; String strB = strA.toLowerCase( ); StrB = strB.toUpperCase( ); String strC = strA.toUpperCase( );

(Multiple Choice)
4.9/5
(33)

These two ways of setting up a String yield identical results: a) String string = new String(12345); b) String string = new String("12345");

(True/False)
4.8/5
(39)

These two ways of setting up a String yield identical results: a) String string = "12345" b) String string = 12345;

(True/False)
4.9/5
(50)
Showing 41 - 58 of 58
close modal

Filters

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