in Education by
What would be the result if a class extends two interfaces and both have a method with same name and signature? Lets assume that the class is not implementing that method. (a) Runtime error (b) Compile time error (c) Code runs successfully (d) First called method is executed successfully This question was posed to me in an online interview. Question is taken from Inheritance in chapter Inheritance of Java Select the correct answer from above options Java questions and answers, Java questions pdf, Java question bank, Java questions and answers pdf, mcq on Java pdf, Java questions and solutions, Java mcq Test , Interview Java questions, Java Questions for Interview, Java MCQ (Multiple Choice Questions),Core Java Questions, Core Java MCQ,core java interview questions for experiencedcore java interview questions for 3 years experience,java programming questions,core java interview questions for freshers,java interview questions and answers for freshers, java programming questions and answers pdf, java interview questions for beginners

1 Answer

0 votes
by
 
Best answer
The correct choice is (b) Compile time error To explain I would say: In case of such conflict, compiler will not be able to link a method call due to ambiguity. It will throw compile time error.

Related questions

0 votes
    What is the process of defining a method in a subclass having same name & type signature as a method ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What is the process of defining two or more methods within same class that have same name but different ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    If super class and subclass have same variable name, which keyword should be used to use super class? ( ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of the following is a method having same name as that of it's class? (a) finalize (b) ... java programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of the following is a method having same name as that of its class? (a) finalize (b) delete ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    If two threads access the same hashmap at the same time, what would happen? (a) ConcurrentModificationException ... and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    What is the process of defining more than one method in a class differentiated by method signature? (a) ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these can be used to differentiate two or more methods having the same name? (a) Parameters ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What would be the behaviour if this() and super() used in a method? (a) Runtime error (b) ... java programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of the following is used for implementing inheritance through class? (a) inherited (b) using (c) ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    If member does not implement serialization, which exception would be thrown? (a) RuntimeException (b) ... and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these will happen if recursive method does not have a base case? (a) An infinite loop ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these interface extends DataOutput interface? (a) Serializable (b) Externalization (c) ObjectOutput (d ... and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these interface extends DataInput interface? (a) Serializable (b) Externalization (c) ObjectOutput (d ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    What would be the behaviour if one parameterized constructor is explicitly defined? (a) Compilation error (b) ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
...