Monday, 15 February 2016

Java Tutorial : Java abstract class(Bank)


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) 
Bank.java
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;
    }
    
}
AbstractClassTest.java
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());
    }

}
Output
HDFC Bank : 10
ICICI Bank : 7
Click the below link to download the code:
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:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • No comments:

    Post a Comment