can a static method be overridden
Answers were Sorted based on User's Feedback
Answer / aswini de
public class Test extends Test2{
public static void main(String args[]){
String str="";
int b=Test.cal(4);
System.out.println(b);
Test t =new Test();
t.displayX();
}
public static int cal(int a){
int b=a*a;
return b;
}
}
public class Test2 {
public static void main(String args[]){
}
public static int cal(int a,int b){
int c=a*b;
System.out.println("IN Super orerriden
methods:");
return c;
}
public void displayX(){
System.out.println("HI i am in Super");
}
}
my Sub Class is Test extends Test2 Class
Common static method is cal()
its run properly. No compile error , NO runtime error
| Is This Answer Correct ? | 4 Yes | 38 No |
How to pass parameters in RMI?
What is clustering? What are the different algorithms used for clustering?
Why do threads block on i/o?
Why doesn’t the focus feature on the tag work in every circumstance?
difference between applicationserver and webserver
whether the connectionpooling used in struts?
What is synchronization and why is it important?
Explain about thread synchronization inside a monitor?
what is stringBuffer and StringBuilder?
can any one tell me how to learn good coding techniques
what is DGC?
how team leaders assign work for the team member like through papers,word document