public class Base { protected int value; public Base () { value = 0; } public Base (int val) { value = val; } public void setValue (int val) { value = val; } public void printIt() { System.out.println ("Inside Base: " + value); } static public void main ( String args[] ) { Base b1; b1 = new Base(); b1. printIt(); b1 = new Base(6); b1. printIt(); b1 = new Other1(); b1. printIt(); b1 = new Other1(); b1.setValue(8); b1. printIt(); for (int i = 0; i < 5; i++) { if (Math.random() > 0.5) { System.out.println ("Creating an instance of Base"); b1 = new Base(); } else { System.out.println ("Creating an instance of Other1"); b1 = new Other1(); } b1.setValue(i); b1. printIt(); } } } class Other1 extends Base { int value2 = 10; public Other1 () { super (); } public Other1 (int val) { super(val); } public void printIt() { System.out.println ("Inside Other1: " + value); } } interface Other2 { public void method1(); public void method2(int val1, int val2); } class Other3 implements Other2 { public void method1() { System.out.println("In method1"); } public void method2(int val1, int val2) { System.out.println("In method2"); } } abstract class Other4 implements Other2 { public void method1() { System.out.println("In method1"); } abstract public void method3(); } class Other5 extends Other4 { /* ?public void method2(int val1, int val2) { System.out.println("In method2"); } */ public void method3() { System.out.println("In method3"); } }