Monday 25 January 2021

Java Program to implement the concept of interface

 Code :

interface I1

{

  void compute1();

}

    class B implements I1

    {

      public void compute1()

      {

        System.out.println("Computed Output");

      }

     }

class Main

{

  public static void main()

  {

    B B1 = new B();

    B1.compute1();

  }

}

Output :  

   



No comments:

Post a Comment