
PRO192_part6

Quiz
•
Other
•
University
•
Hard
Phạm Ngân
Used 4+ times
FREE Resource
21 questions
Show all answers
2.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
31. Suppose threads aThread and bThread are both accessing a shared object named sharedOb, and aThread has just executed:
sharedOb.wait();
What code can bThread execute in order to get aThread out of the waiting state, no matter what other conditions prevail?
A. aThread.notify();
B. aThread.notifyAll();
C. aThread.interrupt();
D. sharedOb.notify();
E. sharedOb.notifyAll();
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
39. What relationship does the extends keyword represent?
A. "is a"
B. "has a"
C. Polymorphism
D. Multivariance
E. Overloading
4.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
38. Given the following code:
1. class Xyz {
2. float f;
3. Xyz() {
4. ??? // What goes here?
5. }
6. Xyz(float f) {
7. this.f = f;
8. }
9. }
What code at line 4 results in a class that compiles?
A. super();
B. this(1.23f);
C. this(1.23f); super();
D. super(1.23f); this(1.23f);
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
37. What happens when you try to compile the following code and run the Zebra application?
class Animal { float weight; Animal(float weight) {
this.weight = weight;
}
}
class Zebra extends Animal {
public static void main(String[] args) { Animal a = new Animal(222.2f);
Zebra z = new Zebra();
}
}
A. Class Animal generates a compiler error.
B. Class Zebra generates a compiler error.
C. The code compiles without error. The application throws an exception when the Animal
constructor is called.
D. The code compiles without error. The application throws an exception when the Zebra
constructor is called.
E. The code compiles and runs without error.
7.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
35. Suppose classes Lemon and Grapefruit extend class Citrus. Which statements are true regard- ing the following code?
1. Grapefruit g = new Grapefruit();
2. Citrus c = (Citrus)g;
3. Lemon lem = (Lemon)c;
A. The cast in line 2 is not necessary.
B. Line 3 causes a compiler error.
C. The code compiles, and throws an exception at line 3.
D. The code compiles and runs without throwing any exceptions.
Create a free account and access millions of resources
Similar Resources on Wayground
18 questions
Newspapers & Journalism

Quiz
•
University
20 questions
Company Law -Quiz II

Quiz
•
University
17 questions
Comparative and superlative adjectives

Quiz
•
KG - University
20 questions
Heritage leadership

Quiz
•
3rd Grade - Professio...
16 questions
oops

Quiz
•
University
20 questions
Google Apps

Quiz
•
12th Grade - Professi...
20 questions
HOC2013 - Meeting practice

Quiz
•
University
16 questions
AIR 1120 Aircraft Bolts

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Appointment Passes Review

Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
Grammar Review

Quiz
•
6th - 9th Grade
Discover more resources for Other
15 questions
Disney Trivia

Quiz
•
University
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
7 questions
What Is Narrative Writing?

Interactive video
•
4th Grade - University
20 questions
Disney Trivia

Quiz
•
University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
5 questions
Examining Theme

Interactive video
•
4th Grade - University
23 questions
Lab 4: Quizziz Questions

Quiz
•
University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University