nuovi test

This commit is contained in:
Fabio Scotto di Santolo
2018-09-25 20:49:47 +02:00
parent 70bbe9ecec
commit d382fdb383
67 changed files with 544 additions and 69 deletions

View File

@@ -0,0 +1,25 @@
package com.oracle.java8.associate;
class Automobile {
private final String drive() {
return "Driving vehicle";
}
}
class Car extends Automobile {
protected String drive() {
return "Driving car";
}
}
public class ElectricCar extends Car {
@Override
public final String drive() {
return "Driving electric car";
}
public static void main(String[] args) {
final Car car = new ElectricCar();
System.out.println(car.drive());
}
}