in a constructor what happen if u call super and this in
the same class? i know that it is not possible to call
both in the same one? if we call what will happen?
Answer Posted / agile being
The question clearly specifies "what happen if u _CALL_
super and this in the same class"
By call, probably, they mean:
this(); /*Invoking the constructor*/
super(); /*Invoking the parent class's constructor*/
I think the right answer is that it will raise a compiler
exception. Such a program will not compile.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
How we can skip finally block of exception even if some exception occurs in the exception block in java?
Outline the major features of java.
What about instanceof operator in java?
Explain treeset?
State the difference between strings and arrays.
What is object-oriented programming?
Define class?
What is an empty class? What functionality does it offer in Java?
What is the purpose of default constructor?
What is the purpose of a volatile variable?
Explain the significance of listiterator.
Why java doesn’t support multiple inheritances?
Is a case study a method or methodology?
What is regex used for?
Write a program to print all permutations of string?