Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

over riding

 
raj joe
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Class MyClass
{

public static meth1()
{
System.out.pritln("parent");
}

}

Class Child extends MyClass
{
public static meth1()
{
System.out.pritln("child");
}

}

The out put is Parent.where as i have overridden the meth1 in child class.What exactly happens when i override static method.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic