interface Colorable {} class Vehicle {} class Car extends Vehicle implements Colorable {} public class Tester { public static void main(String[] args) { Vehicle a = new Car(); Colorable i = (Colorable) a; Vehicle b = new Vehicle(); Colorable j = (Colorable) b; } }
class Vehicle {}
class Car extends Vehicle implements Colorable {}
public class Tester {
public static void main(String[] args) {
Vehicle a = new Car();
Colorable i = (Colorable) a;
Vehicle b = new Vehicle();
Colorable j = (Colorable) b;
}
Oracle Certified Professional Java Programmer
Access: Public Instant Grading
Jobilize.com uses cookies to ensure that you get the best experience. By continuing to use Jobilize.com web-site, you agree to the Terms of Use.