Wednesday, 4 April 2018

Multiple inheritance in java using interface







package javaapplication26;



interface employee

{

   

void printemployeedetails(String n,int id);





}



interface teacher

{



void printteacherdetails(String batch,int id);



}



class teamleader implements employee,teacher

{

   

public void printemployeedetails(String n,int id)

{

    System.out.println("Name of Employee is "+n);

    System.out.println("Employee id : "+id);

}



public void printteacherdetails(String batch,int id)

{

 System.out.println("Batch code: "+batch);

    System.out.println("Teacher id : "+id);

}





public void showleaderdetials(String n)

{

    System.out.println("Team leader name is "+n);

}



}









public class JavaApplication26



{



 

    public static void main(String[] args)

    {

      teamleader tl=new teamleader();

      tl.printemployeedetails("salman", 2245);

      tl.printteacherdetails("1708C1", 4332);

      tl.showleaderdetials("salman");

    }

   

}


No comments:

Post a Comment

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...