Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Student.java added
  • Loading branch information
nudar2107041 committed Aug 21, 2025
commit bf03e98bc9732f4f4cadc297f03b03fd111b9112
37 changes: 37 additions & 0 deletions Student.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
public class Student {
private String name;
private int roll;
private String dept;
private String batch;

// DEFAULT CONSTRUCTOR
public Student() {}

// PARAMETERIZED CONSTRUCTOR
public Student(String name, int roll, String dept, String batch) {
this.name = name;
this.roll = roll;
this.dept = dept;
this.batch = batch;
}

// COPY CONSTRUCTOR
public Student(Student student) {
this.name = student.getName();
this.roll = student.getRoll();
this.dept = student.getDept();
this.batch = student.getBatch();
}

// GETTERS
public String getName() { return name; }
public int getRoll() { return roll; }
public String getDept() { return dept; }
public String getBatch() { return batch; }

// SETTERS
public void setName(String name) { this.name = name; }
public void setRoll(int roll) { this.roll = roll; }
public void setDept(String dept) { this.dept = dept; }
public void setBatch(String batch) { this.batch = batch; }
}