class Vessel { double contents; } class Tank extends Vessel { double length, width, height; Tank(double length, double width, double height) { this.length = length; this.width = width; this.height = height; } } class Barrel extends Vessel { double radius, height; Barrel(double radius, double height) { this.radius = radius; this.height = height; } } public class Vessel1 { public static void main(String[] args) { Tank tank1 = new Tank(15, 9, 12); Tank tank2 = new Tank(0.7, 0.7, 2.05); Barrel b1 = new Barrel(2.5, 8); tank1.contents = 700; System.out.println("Indhold af tank1 = " + tank1.contents); System.out.println("Bredde af tank1 = " + tank1.width); Vessel v1 = tank1; System.out.println("Indhold af v1 = " + v1.contents); } }