This is in relation to a questiuon by someone earlier.
Someone agreed in saying that you cannot override static methods.
They said that the code below is actually hiding the static method from the supere class.
So -- in this scenario in practice what is the difference between hiding a static method as opposed to the effect of overriding a method generally?
class Test1
{
static void go()
{
System.out.println("Hello, go in super class");
}
}
public class
Test extends Test1
{
public static void main(
String [] args)
{
Test t = new Test();
t.cgo();
go();
}
static void go()
{
System.out.println("go overridden");
}
void cgo()
{
super.go();
}
}