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
3
create the 2 Interfaces with breaking the two statements, after breaking , implement it
Answered by
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
Geography,
8 months ago
English,
8 months ago
World Languages,
8 months ago
Science,
1 year ago
Social Sciences,
1 year ago
Biology,
1 year ago