Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as Java by dsfsdf ( 8 years ago )
package department;


public class Department {
    
    private String deptName;
    private int deptCode;
    
    public Department(String deptName,int deptCode){
        
        this.deptName=deptName;
        this.deptCode=deptCode;
    }
    
    
        Person p1=new Person("ronnie",36);
        Student st=new Student("Sheikh Salman",21,"171-15-9398",3.50);
        Teacher th=new Teacher("prof. sabbir",32,"Lecturer","CSE");
     public void displayAll(){
       
        
        p1.display();
        st.disPlay();
        th.disPlay();
        System.out.println("Department:"+deptName+"\nDepartment Code:"+deptCode);
        
    }
    
    
    

    public static void main(String[] args) {
        
        Department d=new Department("CSE",17115);
        
        d.displayAll();
        
        
    }
    
}

 

Revise this Paste

Your Name: Code Language: