public class Starship {
private int warpSpeed;
private int distanceTraveled;
private int numberOfCrewMembers;
public boolean travelTo(int xCoord, int yCoord, int zCoord);
}
public class Enterprise extends Starship {
private int episodesAppearedIn;
public void fireTorpedos(Starship target);
public void teleport(String crewMember);
}
Enterprise enterprise = new Enterprise();
enterprise.travelTo(0, 13, 26);
public class Enterprise extends Starship {
//Enterprise constructor
public Enterprise(int crewlimit) {
super(crewlimit);
}
public String printDetails() {
super.printStarship();
}
}
package com.foundations.furniture;
public class Chair {}
import Java.lang.Math;
import Java.io;
public abstract class Animal { public abstract String speak(); } public class Dog extends Animal { public String speak() { return "ruff"; } } public class Cat extends Animal { public String speak() { return "meow"; } } Animal dog = new Dog(); Animal cat = new Cat();
dog.speak(); cat.speak();
public static void aMethod(int x) {}
public static void aMethod(String word) {}
public static void aMethod(int num1, int num2) {}