Search This Blog

Saturday, 1 February 2014

multiple inheritance in java

/* illustrating the concept of multiple inheritance in java */


interface Name
{
    void StudentName();
}
interface Branch 
{
    void StudentBranch();
}
interface RollNo
{
    void roll();
}

/*
 * Shows the concept of multiple inheritance in java.
 */

public class multipleInherit implements Name,Branch,RollNo
{
    public void StudentName()
    {
        System.out.println("Student Name is : Sanjay kumar singh ");
    }
    public void StudentBranch()
    {
        System.out.println("Student Branch is : Computer Science ");
    }
    public void roll()
    {
        System.out.println("Student roll number is : 21 / 2000263");
    }
    
    public static void main(String[] args)
    {
        multipleInherit mi=new multipleInherit();
        mi.StudentName();
        mi.StudentBranch();
        mi.roll();
    }
            
}

Output


Student Name is : Sanjay kumar singh 
Student Branch is : Computer Science 
Student roll number is : 21 / 2000263

1 comment:

Digital Web Tutor said...

awesome blog for learning programming

Popular Posts