Click here to watch in Youtube :
https://www.youtube.com/watch?v=VGVWH4yhdjA&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java abstract class(Car) |
public abstract class Car { abstract void run(); } class BMWCar extends Car { @Override void run() { System.out.println("BMW Car runs smoothly..."); } } class HyundaiCar extends Car { @Override void run() { System.out.println("Hyundai Car runs smoothly and fast..."); } }
public class AbstractClassTest { public static void main(String[] args) { Car carRef = new BMWCar(); carRef.run(); carRef = new HyundaiCar(); carRef.run(); } }
BMW Car runs smoothly... Hyundai Car runs smoothly and fast...
https://sites.google.com/site/javaee4321/java/AbstractClassDemo_Car_App.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/AbstractClassDemo_Car_App
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/4fab84407fb3cd7dfdf1a3243491a9e829c4d749/BasicJava/AbstractClassDemo_Car_App/?at=master
See also:
No comments:
Post a Comment