javascript
Brief description  about Online courses   join in Online courses
View Shashidhara Sharma U S 's Profile

Interfaces

on executing following code
interface nam
{
abstract void name();
}
interface qul
{
abstract void name();
}
interface col
{
abstract void coll();
}

class Intrf implements nam,qul,col
{
void name()
{

System.out.println("My Name is");
}
void qual()
{
System.out.println("My Qualification is:");
}
void coll()
{
System.out.println("I am a Java Programmer");
}
public static void main(String args[])
{
Intrf in=new Intrf();
in.name();
in.qual();
in.coll();
}
}

i get error as
name() in Intrf cannot implement name() in nam
attempting to assign weaker access privilages
Asked by Shashidhara Sharma U S | Nov 6, 2012 |  Reply now
Replies (1)
View sudha selvakumar 's Profile
Hi, Please use the access specifier 'public' with the methods in the class Intrf.
public void name(), public void qual, public void coll()... and compile the code. It works!
Nov 23, 2012