SHARE
TWEET

Untitled

a guest Jun 20th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Main {
  2.   public static void main(String[] args) {
  3.     System.out.println("Hello world!");
  4.  
  5.     Main d= new Main();
  6.  
  7.     System.out.println(d.getMonth());
  8.     d.setMonth(6);
  9.     System.out.println(d.getMonth());
  10.   }
  11.  
  12.   private int month = 1;
  13.  
  14.   public int getMonth(){
  15.     return month;
  16.   }
  17.  
  18.   public void setMonth(int value){
  19.     if(value > 0 && value < 13)
  20.       month = value;
  21.   }
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top