Posts

Showing posts from August, 2018

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(); ...

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

/*2.  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*/ interface p1    {        int a=10;       void A();    }   interface p2    {        int b=12;       void B();    }  interface p12 extends p1,p2    {        int c=44;       void C();    }       class   Q implements p12     {       public void A()    {  System.out.println("what is your number"+ a);}   public  void B()    {  System.out.println("what i...