Advertisement
cgorrillaha

Untitled

Dec 1st, 2020
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. public class ScopePractice {//class scope starts here
  2.     private int num;
  3.     private String str;
  4.  
  5.     public ScopePractice(int n, String s) {
  6.         int n1=5;
  7.         num = n;
  8.         str = s;
  9.     }
  10.  
  11.     public int getNum() {
  12.         return num;
  13.     }
  14.  
  15.     public void setNum(int n) {
  16.         num = n;
  17.     }
  18.  
  19.     public String getStr() {
  20.         return str;
  21.     }
  22.  
  23.     public void setStr(String s) {
  24.         str = s;
  25.     }
  26. }//class scope ends here
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement