Skip to content

Instantly share code, notes, and snippets.

@xbony2
Created June 9, 2019 13:32
Show Gist options
  • Save xbony2/26105868a4422a476badaa9f6e0b482d to your computer and use it in GitHub Desktop.
Save xbony2/26105868a4422a476badaa9f6e0b482d to your computer and use it in GitHub Desktop.
class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
Main d= new Main();
System.out.println(d.getMonth());
d.setMonth(6);
System.out.println(d.getMonth());
}
private int month = 1;
public int getMonth(){
return month;
}
public void setMonth(int value){
if(value > 0 && value < 13)
month = value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment