
Quiz 3
Authored by Kanyanut HOMSAPAYA
English
University
Used 6+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
13 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
1. Which statements are true? Select the two correct answers.
(A) In Java, the extends clause is used to specify the inheritance relationship.
(B) The subclass of a non-abstract class can be declared abstract.
(C) All members of the superclass are inherited by the subclass.
(D) A final class can be abstract.
(E) A class in which all the members are declared private, cannot be declared public.
(A) and (B)
(B) and (C)
(A) and (E)
(C) and (D)
(D) and (E)
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
2. Which statements are true? Select the two correct answers.
(A) A class can only be extended by one class.
(B) Every Java object has a public method named equals.
(C) Every Java object has a public method named length.
(D) A class can extend any number of classes.
(E) A non-final class can be extended by any number of classes.
(B) and (C)
(A) and (B)
(B) and (E)
(C) and (D)
(D) and (E)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the following classes and declarations, which statements are true? Select the three correct answers.
(A) The Bar class is a subclass of Foo.
(B) The statement b.f(); is legal.
(C) The statement a.j = 5; is legal.
(D) The statement a.g(); is legal.
(E) The statement b.i = 3; is legal.
(A), (B) and (D)
(A), (C) and (E)
(C), (D) and (E)
(B), (C) and (D)
(A), (D) and (E)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given classes A, B, and C, where B extends A, and C extends B, and where all classes implement the instance method void doIt(). How can the doIt() method in A be called from an instance method in C? Select the one correct answer.
super.doIt();
super.super.doIt();
this.super.doIt();
A.this.doIt();
((A) this).doIt();
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which method declarations, when inserted at (7), will not result in a compile-time error? Select the two correct answers.
(A) public int step1(int i) { return 1; }
(B) public String step2(String str2, String str1) { return str1; }
(C) private void step2() { } (D) private static void step2() { }
(E) private static String step2(String str) { return str; }
(F) public MySuperclass makeIt() { return new MySuperclass(); }
(G) public MyClass makeIt2() { return new MyClass(); }
(B) and (G)
(A) and (E)
(C) and (D)
(F) and (G)
(C) and (F)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What would be the result of compiling and running the following program? Select the one correct answer.
The code will compile and print |Toyota|Volvo|12345|54321|, when run.
The code will compile and print |Volvo|Toyota|12345|54321|, when run.
The code will compile and print |Toyota|Toyota|12345|12345|, when run.
The code will compile and print |Toyota|Toyota|12345|12345|, when run.
The code will compile and print |Volvo|Toyota|54321|54321|, when run.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of these field declarations are legal within the body of an interface? Select the two correct answers.
(A) public static int answer = 42;
(B) int answer;
(C) final static int answer = 42;
(D) public int answer = 42;
(E) private final static int answer = 42;
(A) and (B)
(A) and (C)
(C) and (E)
(D) and (E)
(B) and (D)
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
8 questions
Shopping
Quiz
•
University
13 questions
NARRATIVE TENSES AND LINKERS
Quiz
•
University
9 questions
13 American Colonies
Quiz
•
University
15 questions
Rigel A
Quiz
•
10th Grade - Professi...
16 questions
ASEAN
Quiz
•
University
10 questions
Vocabulary - Speakout Intermediate Unit 1
Quiz
•
7th Grade - Professio...
9 questions
SALES G's & S's
Quiz
•
University
9 questions
Home Repairs
Quiz
•
University
Popular Resources on Wayground
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for English
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
23 questions
Subject Verb Agreement
Quiz
•
9th Grade - University
10 questions
THEME
Quiz
•
KG - University
13 questions
Jobs in the Theater
Quiz
•
6th Grade - University
12 questions
Charlie and the Chocolate Factory Chapters 21-30
Quiz
•
2nd Grade - University
20 questions
Context Clues
Quiz
•
KG - University