Hello,
Please help me to solve this error
I have create one interface. and then I have declare one method in it.
Then I have implement the interface and define the method in another class.
After that I have call the method from main.
My program is as follows :
But there is an error occurred
Error :
My file name is 21.java
Please help me to solve this error.
Please help me to solve this error
I have create one interface. and then I have declare one method in it.
Then I have implement the interface and define the method in another class.
After that I have call the method from main.
My program is as follows :
Code:
interface minte
{
void prnt();
}
class abs implements minte
{
void prnt()
{
System.out.print("From the Class abc");
}
}
class inter1
{
public static void main(String args[])
{
abs x=new abs();
x.prnt();
}
}
Error :
Code:
21.java:7: prnt() in abs cannot implement prnt() in minte; attempting to assign
weaker access privileges; was public
void prnt()
^
1 error
Please help me to solve this error.
Comment