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
What is the properties class?
What is protected access modifier?
4.1 Supply contracts (in the form of comments specifying pre- and post conditions) for the enqueue() method of the LinkedQueue class given in the Appendix. (2) 4.2 Let Thing be a class which is capable of cloning objects, and consider the code fragment: Thing thing1 = new Thing(); //(1) Thing thing2 = thing1; //(2) Thing thing3 = (Thing) thing1.clone(); //(3) Explain how the objects thing2 and thing3 differ from each other after execution of the statements. (
Explain with example the concept of constant variable in java.
What is flag in java?
How do you achieve polymorphism in java?
What is class variable java?
How to run a JAR file through command prompt?
What is the meaning of nullable?
Can we sort list in java?
What is the meaning of find and replace?
How do you avoid global variables?
Does isempty check for null?
What is generics in java interview questions?
Does variable declaration allocate memory?