Difference between this(), super()?
Answer Posted / shanthappa
"this" is the implicit keyword/object oriented by the jvm and supplied to every java programs for two purposes.
1) It points to current class object
2) It whenever formal parameters of the class are similar then jvm gets an ambiguity.
"super" is a keyword which will differentiate base class features with derived class features.
The keyword 'super' is placing an important role in three places in java...
1)at variable level
2)at constructor level
3)at method level
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Can I import same package/class twice?
What is difference between add() and addelement() in vector?
For ease of programming you can consider the maze as a 2D array with colors represented by below integer and characters (in capital letters). • B - Black • W -White • G- Green • R- Red R B W B W W W W W W B W B B W W W W W W W B W B W W W B W W W W B B W W W B W W W B W W B B B B W B W B W W B W W W B W W W B B B W W B W W W B W W B W B W W W B W B W W W W B B W W W W B W W W W W G Shortest Route Problem: • Solution that finds the shortest Route between Red and Green White will have 1 Weight. Red and Green carry no weights. Shortest path is the path with less weight when you add up the weights in the path.
What is polymorphism and what are the types of it?
What is the difference between the font and fontmetrics classes in java programming?
What is the purpose of the enableevents() method?
Can a main method be overloaded?
List the different types of classloaders in java.
What exactly is a .class file?
What does replaceall do in java?
Why is multiple inheritance not supported in java?
What is the importance of hashcode() and equals() methods?
Explain tree set and its features?
What is final, finally, finalize?
How garbage collection is done in java?