BASIC 2 HIFI PROGRAM ...
ALL HERE

Monday, 22 December 2014

MULTIPLE INHERITANCE PROGRAM

interface months {
abstract void summer();
abstract void winter();
}

interface gender {
void male();
void female();
}



class important {
void tie()
{
System.out.println("wearing tie");
}
void belt()
{
System.out.println("wearing belt");
}
}

 class man extends important implements months,gender {
public void summer()
{
System.out.println("summer season");
}
public void winter()
{
System.out.println("winter season");
}
public void male()
{
System.out.println("a male");
}
public void female()
{
System.out.println("a female");
}
void shirt()
{
System.out.println("wearing shirt");
}
void trouser()
{
System.out.println("wearing trouser");
}
}

public class multi_inherit {
public static void main(String[] args)
{
man RAHUL=new man();
RAHUL.summer();
RAHUL.male();
RAHUL.belt();
RAHUL.shirt();
}
}

No comments:

Post a Comment