Sunday, 23 October 2016

interface basics

interface

  • I hope by this time you may good at abstract method & class. If it is then really good to start to learn about interface.
Method 
  • Java method have two parts,
    • First one is method name and parameters(if exists)
    • Second is method body.
Example 
                         public void method1(int a, int b)
                         {
                                This is body of the method;
                         }
Implemented method
  • A method which has method name and method body is called implemented method.
  • We can say these methods as non abstract methods.
Example 
                         public void sum(int a, int b)
                         {
                                This is body of the method;
                         }
Unimplemented method
  • A method which has only method name and no method body is called unimplemented method.
  • We can say these methods as abstract methods.
Example 
                         public abstract void withDraw(int money);

Thanks for your time.
Nireekshan