Forums Register Login

method calling

+Pie Number of slices to send: Send
hi to all
I m having few doubts...
1.In the case of overriding static mehod of super class in sub class
while calling the same method in the subclass with the object of of type superclass.....which method will be called???

2.what is the order of compilation in java programming?

3.
//method in the super class

public void methodA(){};

//method in the sub class

void methodA(){};

Are these two are different methods??


Thanks in advance....please clarrify my doubts.....
+Pie Number of slices to send: Send
1. See Overriding vs. Hiding.

2. I'm not sure what this means. Could you be more specific?

3. If you test this, the compiler will generate an error explaining why you can't do this.
+Pie Number of slices to send: Send
you cannot override static methods.
Whose rules are you playing by? This tiny ad doesn't respect those rules:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 738 times.
Similar Threads
Constructor
Differance in overriding variable and method
Casting of Reference
Regarding Method Shadowing
Strange "this" behavior
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:25:38.