Click here to watch in Youtube :
https://www.youtube.com/watch?v=ZRdgrLs-rRo&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : When to use Java abstract class and abstract method |
abstract class Car { abstract void engine(); } class HondaCar extends Car { @Override void engine() { System.out.println("Honda Car Engine Implementation..."); // Honda Car implementation } } class SwiftCar extends Car { @Override void engine() { System.out.println("Swift Car Engine Implementation..."); // Swift Car implementation } }
public class AbstractClassTest { public static void main(String[] args) { Car carRef = new HondaCar(); carRef.engine(); carRef = new SwiftCar(); carRef.engine(); } }
Honda Car Engine Implementation... Swift Car Engine Implementation...
https://sites.google.com/site/javaee4321/java/AbstractClassDemo_when_to_use_App.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/AbstractClassDemo_when_to_use_App
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/d0d6b1dff9f31bbeec3615564d292efcb8f01f3f/BasicJava/AbstractClassDemo_when_to_use_App/?at=master
See also:
No comments:
Post a Comment