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 a component can be placed on Windows?
how to search the pertical objects in a Collections
hi, All are saying that now software field position is not good and in 5-10yrs total software field ll be saturated . is it true? i am unable decide ii continue in this field or not please tell me?
If I define a method in JSP scriplet <%..%>, where will it go after translation into a servlet?
What class is the top of the awt event hierarchy?
What is the form of storage space in java?
Where can I find seam examples and documentation?
What are the steps to write p-to-p model application?
Explain Object Serialization and it can be used?
What is re-entrant. Is session beans reentrant. Is entity beans reentrant?
How substring() method of string class create memory leaks?
Urgent Openings for Java and .NET ( India, Singapore, Australia, Japan)