i was trying to explain a friend about interface
i have followed the abstract concept but dont know to how to demonstrate

inteface a
{
void meth(int i){
};
}
class dani implements a
{
public static void main(String args[])
{int i;
public void meth(5);
System.out.print(i);
}
}

if i dont include method meth it should show me an error as per interface rule

Not sure why this is "solved". Code will not compile, and does not illustrate the correct use of an interface even if it did.

to be honest i was worried about my reputation after typing the program. i thougt i could put more efforts myself but if you tell me whats wrong in the code and how i demonstrate this to my friend.I am clear with the concept but not sure about coding in java thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.