Skip to content

Instantly share code, notes, and snippets.

@danielkwok21
Created October 10, 2017 04:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielkwok21/78c5957c0b907efc58e16069103033a2 to your computer and use it in GitHub Desktop.
Save danielkwok21/78c5957c0b907efc58e16069103033a2 to your computer and use it in GitHub Desktop.
OOP example
public class Car {
public void drive(){
System.out.println("Vroom vroom");
}
public void honk(){
System.out.println("Honk Honk");
}
public void radio(){
System.out.println("Song Song");
}
}
public class myCar {
public static void main(String args[]){
Porsche myPorsche = new Porsche();
myPorsche.honk();
}
}
import java.util.*;
public class Porsche extends Car{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment