Skip to content

Instantly share code, notes, and snippets.

@JacobLeach
Created September 30, 2014 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JacobLeach/679e3ac2513597afb221 to your computer and use it in GitHub Desktop.
Save JacobLeach/679e3ac2513597afb221 to your computer and use it in GitHub Desktop.
public class Test
{
public static void main(String[] args)
{
Parent a = new Parent();
Child b = new Child();
a.hello();
b.hello();
a.hello2();
b.hello2();
a.hello3();
b.hello3();
}
static class Parent
{
public static void hello()
{
System.out.println("Parent");
}
public static void hello2()
{
hello();
}
public static void hello3()
{
hello();
}
}
static class Child extends Parent
{
public static void hello()
{
System.out.println("Child");
}
public static void hello2()
{
hello();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment