Home
Video Series
Fast Math Tricks
Quantitative Aptitude
Class 8 Maths Videos
Class 9 Maths Videos
Class 10 Maths Videos
Reasoning Videos
Blog
Store
Register /Login
Home
Topic
Question
Which is true?
Options:
A
.
 "X extends Y" is correct if and only if X is a class and Y is an interface
B
.
 "X extends Y" is correct if and only if X is an interface and Y is a class
C
.
 "X extends Y" is correct if X and Y are either both classes or both interfaces
D
.
 "X extends Y" is correct for all combinations of X and Y being classes and/or interfaces
Answer: Option C
Submit Your Solution Below and Earn Points !
0 Likes
Next Question
Report Problem
Share
Submit Solution
Your email address will not be published.
Required fields are marked
*
More Questions on This Topic :
Question 1.
Which of the following is true? 1. A class can extend more than one class. 2. A class can extend only one class but many....A class can extend one class and implement many interfaces.
Question 2.
What is the result of compiling and running the following code? class Base{ public Base(){ System.out.print("Base"); } }....extends Base{ public Derived(){ this("Examveda"); System.out.print("Derived"); } public Derived(String s){ System.out.print(s); } public static void main(String[] args){ new Derived(); } }
Question 3.
The concept of multiple inheritance is implemented in Java by I. Extending two or more classes. II. Extending on....and implementing one or more interfaces. III. Implementing two or more interfaces.
Question 4.
What is the output of the following program code? abstract class C1{ public C1(){ System.out.print(1); } } class C2 exte....extends C2{ public C3(){ System.out.println(3); } } public class Test{ public static void main(String[] a){ new C3(); } }
Question 5.
What will be the output? interface A{ public void method1(); } class One implements A{ public void method1(){ System.out....extends Two{ public static void main(String[] args){ A a = new Two(); a.method1(); } }
Question 6.
Determine output: class A{ public void method1(){ System.out.print("Class A method1"); } } class B extends A{ public voi....a = new A(); C c = new C(); c.method2(); a = c; a.method3(); } }
Question 7.
What is the result of compiling and running this program? class Mammal{ void eat(Mammal m){ System.out.println("Mammal e....main(String[] args){ Mammal h = new Horse(); Cattle c = new Horse(); c.eat(h); } }
Question 8.
What will be printed after executing following program code? class Base{ int value = 0; Base(){ addValue(); } void addVa....class Test{ public static void main(String[] args){ Base b = new Derived(); System.out.println(b.getValue()); } }
Question 9.
What will be the output? class Parent{ public void method(){ System.out.println("Hi i am parent"); } } public class Chil....am Child"); } public static void main(String args[]){ Child child = new Child(); child.method(); } }
Question 10.
What will be the output? class One{ final int a = 15; } class Two extends One{ final int a = 20; } public class Test ext....= 30; public static void main(String args[]){ Test t = new One(); System.out.print(t.a); } }
Latest Videos
Chapter 1 - GLOBAL STEEL SCENARIO & INDIAN STEEL INDUSTRY
Part 1 : (13-04-2024)
INDUSTRY AND COMPANY AWARENESS (ICA)
Direction Sense Test
Part 1
Reasoning (Hindi)
Chapter 1 - RMHP / OHP / OB & BP
Part 1 : (14-02-2024)
GPOE
Cube & Cuboid
Part 1
Reasoning (Hindi)
Data Interpretation (DI)
Basic Concept
Reasoning (Hindi)
Counting Figures Part 1
Counting Of Straight Lines
Reasoning (Hindi)
Sail E0 free webinar
Webinars
Real Numbers
Part 7
Class 10 Maths
Real Numbers
Part 1
Class 10 Maths
Polynomials
Part 1
Class 10 Maths
Latest Test Papers
Pie Chart - Test Paper 1
Data Interpretation
Reasoning & DI
Tabulation - Test Paper 2
Data Interpretation
Reasoning & DI
Test Paper 1
Direction Sense Test
Reasoning & DI
ICA , RDIC,GFM
Free Modal Test Paper - Non - Technical Branch
Old Syllabus 2022 - SAIL Junior Officer E0
GFM Combined 1
Free Revision Test
SAIL JO E-0
One click Login
Login With Google
Old way of Login
Login With Email
Submit Problem
Problem Type (Required)
Choose Problem Type
Incorrect Topic
Incomplete Question
Wrong Question
Wrong Solution
Wrong Option
Explaination : Please write a little about the issue
Submit Solution