
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
10 questions
Quiz 1 (Grammar In Use)
Quiz
•
5th Grade - University
13 questions
MUSIC (Unit 4 - Vocabulary)
Quiz
•
6th Grade - University
15 questions
TALKSHOW TIẾNG ANH SAY HI - IUH
Quiz
•
University
15 questions
Simple Past - Pop Up Quiz
Quiz
•
University
14 questions
English quiz 1
Quiz
•
10th Grade - University
18 questions
Reading
Quiz
•
University
10 questions
Expressions of quantity
Quiz
•
10th Grade - University
10 questions
Baggage lost
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th 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
21 questions
Past Perfect Tense
Quiz
•
University
21 questions
Contractions
Quiz
•
KG - University
8 questions
Because of Winn-Dixie Chapters 4-6
Quiz
•
KG - University
14 questions
Charlie and the Chocolate Factory Chapters 11-20
Quiz
•
2nd Grade - University