fork download
  1. /* package whatever; // don't place package name! */
  2. abstract class Car{
  3. abstract void accelerate();
  4. }
  5. class Lamborghini extends Car{
  6. @Override
  7. void accelerate() {
  8. System.out.println("90 mph"); }
  9. void nitroBooster(){
  10. System.out.print("150 mph"); }
  11. public static void main(String[] args) {
  12. Car mycar=new Lamborghini();
  13. Lamborghini lambo=(Lamborghini) mycar;
  14. lambo.nitroBooster();}}
Success #stdin #stdout 0.08s 47264KB
stdin
Standard input is empty
stdout
150 mph