Skip to content

Instantly share code, notes, and snippets.

@wowo
Created January 3, 2010 10:59
Show Gist options
  • Save wowo/267944 to your computer and use it in GitHub Desktop.
Save wowo/267944 to your computer and use it in GitHub Desktop.
class A
{
int i = 1;
public int print()
{
System.out.println(" z klasy A ");
return i;
}
}
public class B extends A
{
int i = 2;
public int print()
{
System.out.print(" z klasy B ");
return i;
} public static void main(String[] arg)
{
A a = new B();
System.out.println("i " + a.print()); }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment