
PRO192_part6

Quiz
•
Other
•
University
•
Medium
Phạm Ngân
Used 3+ times
FREE Resource
21 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A. public
B. protected
C. default
D. private
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 Quizizz
16 questions
College Quiz

Quiz
•
KG - University
19 questions
Budget Legislation Nat Econ 5

Quiz
•
University
19 questions
Copyright & Fair Use for Educators

Quiz
•
9th Grade - Professio...
20 questions
Lesson 8_Support Measures for Persons with Disabilities

Quiz
•
University
26 questions
Python Quiz SE 27/10/2023

Quiz
•
University
20 questions
Tech quiz-july

Quiz
•
University
20 questions
College and Career Olympics

Quiz
•
KG - University
20 questions
Logical Reasoning

Quiz
•
University
Popular Resources on Quizizz
20 questions
math review

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
10 questions
Human Body Systems and Functions

Interactive video
•
6th - 8th Grade
19 questions
Math Review

Quiz
•
3rd Grade
45 questions
7th Grade Math EOG Review

Quiz
•
7th Grade
Discover more resources for Other
20 questions
Summer

Quiz
•
KG - University
6 questions
Railroad Operations and Classifications Quiz

Quiz
•
University
47 questions
2nd Semester 2025 Map Final

Quiz
•
KG - University
43 questions
Science 5th Grade EOG Review #3

Quiz
•
KG - University
24 questions
Cartoon Characters

Quiz
•
KG - University
9 questions
What is your personality?

Quiz
•
University
10 questions
El Presente

Quiz
•
1st Grade - University
32 questions
NC Biology EOC Review : Heredity, Genetics, Biotechnology

Quiz
•
KG - University