Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.1 kB
2
Indexable
Never
/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.mycompany.lab6;
import java.util.ArrayList;
/**
 *
 * @author hp
 */
public class Faculty {
    private String name;
    private String email;
    private String designation;
    private String contact;
    private int id;
    private int salary;
    private ArrayList<Course>courses=new ArrayList<>();
    public Faculty(String name,String email,String designation,String contact,int id,int salary ){
        this.name=name;
        this.email=email;
        this.designation=designation;
        this.contact=contact;
        this.id=id;
        this.salary=salary;
    }
    public void assignCourse(Course c){
        courses.add(c);
    }
    @Override
    public String toString(){
        return "ID: "+String.valueOf(id)+"\n"+"Salary: ""\n"+String.valueOf(salary)+"\n"+"Nane: "name+"\n"+"Email: "+email+"\n"+"Designation:"+designation ;
    }
    
    
}