WAP that create interface on that you declare one method interest(p,r,n) then create two class simple and compound that implements interest and find simple and compound interest.

    /*1.  WAP that create interface on that you declare one method interest(p,r,n) then create two
class  simple and compound that implements interest and find simple and compound interest.
*/


interface k1
    {
     void p();
    }

interface k2
   {
     void r();
   }
 
  interface k3
   {
     void n();
   }
  class Simple implements  k1,k2
{

    public void p()

{ System.out.println("1 st");}

public void r()

 {System.out.println("2nd");}

}
class Compound implements  k3
{
    public void n()
 {
  System.out.println(" 3rd");
  }
}
class Kk
   {
    public static void main(String  []args)
        {
           Simple  s=new Simple();
            Compound c=new  Compound();
                  s.p();
                   s.r();
                    c.n();
         }
}  


Comments

Popular posts from this blog

Write a java program to calculate gross salary & net salary taking the following data

WAP a program that illustrates interface inheritance. Create two interface p1 and p2 . create Interface p which extends p1 and p2 and then create interface p12 which extends p12. Each interface declare one constants and one method. Create class Q which implements p12 and define all the methods of interface which displays value of constants