0

Possible Duplicate:
Why doesn't Java allow overriding of static methods?

 public class Start extends a{
    @Override
   static void f()//this shows up as an error in eclipse
    {
        System.out.println("child class");
    }
    public static void main(String[] args) {

a.f();
Start.f();
    }

}
class a
{    
    static void f()
    {
        System.out.println("parent class");
    }
}    

why does java does not support static method overriding.....when I use annotation it definitely points out that static method can not be overriden ....please provide me a simple explanation

Community
  • 1
  • 1
Nav
  • 9,966
  • 19
  • 54
  • 83
  • What are you trying to achieve? – Gabe Dec 04 '11 at 16:28
  • I could not understand why static methods could not be overriden....at first I was not sure whether it can be done or not..so I experimented with the above code to see for myself whether it can be done or not...but i didn't understand the logic behind why it can't be done..can you please explain :( – Nav Dec 04 '11 at 16:34

0 Answers0