Click here to watch in Youtube :
https://www.youtube.com/watch?v=ISPlfNxG5rk&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java abstract class(Bank) |
public abstract class Bank { abstract int getRateOfInterest(); } class HDFC extends Bank { @Override int getRateOfInterest() { return 10; } } class ICICI extends Bank { @Override int getRateOfInterest() { return 7; } }
public class AbstractClassTest { public static void main(String[] args) { Bank bankRef = new HDFC(); System.out.println("HDFC Bank : "+bankRef.getRateOfInterest()); bankRef = new ICICI(); System.out.println("ICICI Bank : "+bankRef.getRateOfInterest()); } }
HDFC Bank : 10 ICICI Bank : 7
https://sites.google.com/site/javaee4321/java/AbstractClassDemo_Bank_App.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/AbstractClassDemo_Bank_App
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/616eaf1c2bb4551c34e3415baa3ee3135766bffc/BasicJava/AbstractClassDemo_Bank_App/?at=master
See also:
No comments:
Post a Comment