Skip to content

Commit

Permalink
access specifier demo: person class blueprint
Browse files Browse the repository at this point in the history
  • Loading branch information
NirmalSilwal committed Sep 2, 2020
1 parent a08f0e1 commit e57801f
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions CodingBlocks Training/Day15 Reference/person2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package OOPS;

public class person2 {

private String name;
private int age;
private int rollno;

// go to "Source > Generate Getters and Setters" and select variables you want
// to generate getter and setter by IDE

public int getRollno() {
return rollno;
}

public void setRollno(int rollno) {
this.rollno = rollno;
}

public String getName(){
return this.name;
}

public void setName(String name){
this.name = name;
}
}

0 comments on commit e57801f

Please sign in to comment.