in Education by
What would be the behaviour if this() and super() used in a method? (a) Runtime error (b) Throws exception (c) compile time error (d) Runs successfully The question was posed to me during a job interview. This is a very interesting question from Constructor in portion Classes and Methods 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
Right answer is (c) compile time error The explanation: this() and super() cannot be used in a method. This throws compile time error.

Related questions

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
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 methods is used to avoid serialization of new class whose super class already implements ... 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 this method of class String is used to obtain a length of String object? (a) get() (b ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of this method of class String is used to extract a substring from a String object? (a) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of this method of class StringBuffer is used to reverse sequence of characters? (a) reverse() (b ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of this method of class StringBuffer is used to get the length of the sequence of characters? (a ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of this method is used to change an element in a LinkedList Object? (a) change() (b) set( ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these is a super class of wrappers Double and Float? (a) Long (b) Digits (c) Float ( ... java programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these is a super class of wrappers Byte and short wrappers? (a) Long (b) Digits (c) ... java programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these is a super class of wrappers Double & Integer? (a) Long (b) Digits (c) Float ( ... java programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these is a super class of wrappers Long, Character & Integer? (a) Long (b) Digits (c) ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these is a super class of Character wrapper? (a) Long (b) Digits (c) Float (d) ... java programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
...