Exam 3: Object-Oriented Programming, Part 1: Using Classes

arrow

5,026 students have unlocked this exam

  • Select Tags
search iconSearch Question
  • Select Tags

What is the value of the expression Math.sqrt( 4 )?

(Multiple Choice)
4.7/5
(38)

In which package is the class DecimalFormat?

(Multiple Choice)
4.8/5
(31)

The accessors are the get methods.

(True/False)
4.7/5
(38)

When writing code, you can include two forward slashes for a comment and then later replace them with back slashes to uncomment.

(True/False)
4.7/5
(34)

What is the output of this code sequence? String word = "Java"; System.out.println( word.length( ) );

(Multiple Choice)
4.8/5
(37)

Wrapper classes define an instance variable of a primitive data type and provide useful methods for converting the primitive data types into objects.

(True/False)
4.9/5
(30)

Why do you think the String class is in the java.lang package?

(Essay)
4.7/5
(46)

Which keyword allows you to use a Java class inside a program?

(Multiple Choice)
4.8/5
(42)

In what package is the class Scanner?

(Multiple Choice)
4.9/5
(44)

Write a Java statement to import the DecimalFormat class from the appropriate package.

(Short Answer)
4.7/5
(39)

When an object reference is first declared, its value is null.

(True/False)
4.8/5
(41)

Java would generate a compiler error and a run-time error if you attempt to call a method using an object reference whose value is null.

(True/False)
4.8/5
(32)

What is the value of the expression Math.pow( 3, 2 )?

(Multiple Choice)
4.8/5
(35)

By convention, method names, instance variables, and object names start with a lowercase letter.

(True/False)
4.9/5
(40)

The automatic conversion from a primitive numeric type to its wrapper class is called:

(Multiple Choice)
4.9/5
(49)

The automatic conversion from a numeric wrapper class to the corresponding primitive numeric type is called:

(Multiple Choice)
4.9/5
(42)

What is the output of this code sequence? String word = "Java"; System.out.println( word.charAt( 1 ) );

(Multiple Choice)
4.8/5
(42)

The first index of a String is 1.

(True/False)
4.9/5
(36)

Which methods of the String class would you use to retrieve the user name from an email address whose format is username@provider?

(Essay)
4.9/5
(38)

String is in the java.string package.

(True/False)
5.0/5
(32)
Showing 21 - 40 of 62
close modal

Filters

  • Essay(3)
  • Multiple Choice(18)
  • Short Answer(15)
  • True False(26)
  • Matching(0)