Exam 3: Using Classes and Objects

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

What is the function of the dot operator?

Free
(Multiple Choice)
4.8/5
(34)
Correct Answer:
Verified

E

What is autoboxing?

Free
(Essay)
4.7/5
(35)
Correct Answer:
Verified

Autoboxing provides automatic conversions between primitive values and corresponding wrapper objects. It makes your code shorter by relieving you of the need to provide explicit wrapping of primitive values and explicit extraction of primitive values.

Which statement is true, given the following code fragment? String strA = "aBcDeFg"; String strB = strA.toLowerCase(); StrB = strB.toUpperCase(); String strC = strA.toUpperCase();

Free
(Multiple Choice)
4.8/5
(34)
Correct Answer:
Verified

B

In a development environment that fully supports JavaFX, which of the following is true?

(Multiple Choice)
4.9/5
(38)

Write a declaration for a Rectangle named squareShape that is 400 pixels wide, 400 pixels high, and its upper-left corner position is at point (50, 50).

(Multiple Choice)
4.8/5
(36)

An API is

(Multiple Choice)
4.9/5
(37)

An alias is when

(Multiple Choice)
4.8/5
(36)

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

(True/False)
4.7/5
(36)

Write a statement to create a Color object equivalent to Color.ORANGE using the rgb method.

(Short Answer)
4.7/5
(41)

What happens if you attempt to use a variable before it has been initialized?

(Multiple Choice)
4.8/5
(40)

These two ways to set up a String will yield identical results: String my_string = new String("123.45"); String my_string = "" + 123.45;

(True/False)
4.9/5
(32)

These two ways to set up a String will yield identical results: String my_string = "12345"; String my_string = 12345;

(True/False)
4.9/5
(35)

Given two String variables, s1 and s2, is it possible for (s1 != s2)to be true while (s1.equals(s2)) is also true? Why or why not?

(Essay)
4.8/5
(32)

These two ways to set up a String will yield identical results: String my_string = new String(12345); String my_string = new String("12345");

(True/False)
4.8/5
(34)

Problem Ch 03-1 Assume an interactive Java program which asks the user for his/her first name and last name, and outputs the user's initials. -Refer to Problem Ch 03-1. Write a statement to guarantee that the initial will be a capital letter.

(Short Answer)
4.8/5
(30)

The String class's compareTo method

(Multiple Choice)
4.7/5
(40)

Why is it often a good idea to group particular elements together in a scene?

(Essay)
4.8/5
(38)

Which of the following will yield a pseudorandom number in the range [-5, +5), given: Random gen = new Random();

(Multiple Choice)
4.8/5
(30)

Which is now the preferred approach for developing Java programs that use graphics and GUIs?

(Multiple Choice)
4.9/5
(37)

Problem Ch 03-1 Assume an interactive Java program which asks the user for his/her first name and last name, and outputs the user's initials. -Refer to Problem Ch 03-1. Write a statement using a Scanner method to get the first name interactively.

(Short Answer)
4.8/5
(38)
Showing 1 - 20 of 49
close modal

Filters

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