/home/caleb/ASDV-Java/Semester 2/Assignments/lab4_CalebFontenot/src/main/java/com/calebfontenot/lab5_calebfontenot/A.java |
package com.calebfontenot.lab5_calebfontenot;
public class A {
public A() { System.out.println("A constructor was called"); }
public A(String msg) {System.out.println(msg);}
public A(String msg1, String msg2) {
this (msg1 + "; " + msg2);
System.out.println("A 2-parm constructor was called");
}
public void instanceMethod1() { System.out.println("Instance method1 called from A"); }
public void instanceMethod2() { System.out.println("Instance method2 called from A"); }
public static void staticMethod() {System.out.println("Static method 2 called from A"); }
}
class B extends A {
public B() {System.out.println("B constructor called");}
public B(String msg)
{
System.out.println("B constructor called");
System.out.println(msg);
}
public void instanceMethod1() { System.out.println("Instance method1 called from B"); }
public void instanceMethod2() { System.out.println("Instance method2 called from B"); }
public static void staticMethod() {System.out.println("Static method 2 called from B"); }
}