Exam 3: Using Classes and Objects
Exam 1: Introduction64 Questions
Exam 2: Data and Expressions67 Questions
Exam 3: Using Classes and Objects49 Questions
Exam 4: Writing Classes53 Questions
Exam 5: Conditionals and Loops38 Questions
Exam 6: More Conditionals and Loops35 Questions
Exam 7: Object-Oriented Design44 Questions
Exam 8: Arrays45 Questions
Exam 9: Inheritance49 Questions
Exam 10: Polymorphism40 Questions
Exam 11: Exceptions39 Questions
Exam 12: Recursion55 Questions
Exam 13: Collections60 Questions
Select questions type
In addition to providing a mechanism to convert primitive data into objects, what else do the wrapper classes provide?
(Multiple Choice)
4.9/5
(39)
These two ways to set up a String will yield identical results:
String my_string = new String("a bunch of words");
String my_string = "a bunch of words";
(True/False)
4.8/5
(32)
Rewrite the following five assignment statements into a single statement using prefix and postfix increment and decrement operators as necessary. Assume all variables are int variables.
x = y + 1;
y = y + 1;
z = z - 1;
x = x - z;
x = x + 1;
(Short Answer)
4.7/5
(39)
The advantage(s) of the Random class's pseudorandom number generators, compared to the Math.random method, is(are) that
(Multiple Choice)
4.8/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. For the program to get a name interactively a Scanner object must be instantiated. Write the Java statement to do this.
(Short Answer)
4.8/5
(40)
Assume you write a program that uses the Random class but you fail to include an import statement for java.util.Random or java.util.*. What will happen when you attempt to compile and run your program?
(Multiple Choice)
4.9/5
(35)
The following statement will display the value 127.
System.out.println("123" + 4);
(True/False)
4.9/5
(27)
Which of the following packages includes classes that represent shapes in JavaFX?
(Multiple Choice)
4.9/5
(44)
What does the following code fragment do? Circle circle = new Circle(100, 100, 50);
Circle.setFill(Color.GREEN);
Rectangle rectangle = new Rectangle(70, 70, 225, 75);
Rectangle.setStroke(Color.BLUE);
Rectangle.setStrokeWidth(2);
Rectangle.setFill(null);
(Multiple Choice)
4.9/5
(36)
You may apply the prefix and postfix increment and decrement operators to instances of the Integer class.
(True/False)
5.0/5
(34)
You may use the String.replace() method to remove characters from a String.
(True/False)
4.8/5
(25)
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 method to extract the initial from the first name.
(Short Answer)
4.8/5
(46)
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)
5.0/5
(45)
In the StringMutation program shown in Listing 3.1, if phrase is initialized to "Einstein", what will Mutation # 3 yield if mutation1 = phrase.concat(".")?
(Multiple Choice)
4.9/5
(34)
What will be displayed by the following command? System.out.println(Math.pow(3, 3-1));
(Multiple Choice)
4.8/5
(33)
Showing 21 - 40 of 49
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)