-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
access specifier demo: person class blueprint
- Loading branch information
1 parent
a08f0e1
commit e57801f
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |