Which one is correct declaration for implementing two interfaces?

Unit-2 Revision quiz

Quiz
•
Professional Development
•
Professional Development
•
Medium
Ms STAFF
Used 5+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
class C implements A, B {}
class C implements A, implements B {}
class C implements A extends B {}
class C extend A, B {}
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
which type of inheritance is not allowed in java directly
Multi level
Multiple
Hierarhical
single
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Suppose the class Undergraduate extends the class Studentwhich extends the class Person. Given the following variable declaration:
Person p = new Person();
Student s = new Student();
Undergraduate ug = new Undergraduate();
Which of the following assignments are legal?
p =ug;
p = newUndergraduate();
ug = newStudent();
ug =p;
s = newPerson();
I andIV
III, II andIV
I and II
III andIV
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the result of this code will be?
Interface A {
inti =111;
}
class B implements A { void methodB(){
i =222;
System.out.printl(i);
}
}
There is no main () method so the program is notexecutable.
The value of i will be printed as 111, as it is static and final bydefault.
The value of i will be printed as 222, as it is initialized in classB.
Compile timeerror
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
which keyword is used to inherit the properties from a class
impements
extends
final
static
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Can we inherit all the properties from parent class
yes all the propeties canbe inherited
yes all the properties except private property
yes all the properties except protected property
yes all the properties except default property
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Multiple inheritances in java can be achieved in java using
packages
classes
interfaces
none
Create a free account and access millions of resources
Similar Resources on Quizizz
28 questions
java Programming1

Quiz
•
Professional Development
25 questions
core java 2

Quiz
•
Professional Development
20 questions
VCE TalentNext-2021 Quiz-2

Quiz
•
Professional Development
25 questions
core java basics

Quiz
•
Professional Development
20 questions
flutter oop quiz

Quiz
•
Professional Development
20 questions
Top Notch 2 Unit 1 Practice

Quiz
•
Professional Development
20 questions
La sintassi CSS

Quiz
•
9th Grade - Professio...
25 questions
Front End Final Assessment

Quiz
•
Professional Development
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade