We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ff2c06 commit e64efdcCopy full SHA for e64efdc
OOPExamples/Student.java
@@ -0,0 +1,33 @@
1
+public class Student {
2
+ private String name;
3
+ private int age;
4
+ private int roll;
5
+
6
+ //constructors
7
+ public Student(String name, int age, int rollNo){
8
+ this.name = name;
9
+ this.age = age;
10
+ this.rollNo = roll;
11
+ }
12
+ //getters
13
+ public String getName(){
14
+ return name;
15
16
+ public int getAge(){
17
+ return age;
18
19
+ public int getRollNo() {
20
+ return roll;
21
22
+ //setters
23
+ public void setName(String name) {
24
25
26
+ public void setAge(int age) {
27
28
29
+ public void setRollNo(int rollNo) {
30
31
32
+}
33
0 commit comments