Computer Science, asked by yadhavlaasya2782, 1 year ago

Write a program to create interface a, in this interface we have two method meth1 and meth2. implements this interface in another class named myclass.

Answers

Answered by sshaardul
3
create the 2 Interfaces with breaking the two statements, after breaking , implement it
Answered by streetwalker1684
0

Answer:

public interface A

{

 public void meth1();

 public void meth2();

}

public class Myclass implements A

{

 public void meth1()

 {

   System.out.println("meth1 implements in meth2");

 }

 public void meth2()

 {

   System.out.println("meth2 implements in meth1");

 }

 public static void main(String [] args)

 {

   Myclass obj=new Myclass();

   obj.meth1();

   obj.meth2();

 }

}

Explanation:

Similar questions