Created
June 9, 2019 13:32
-
-
Save xbony2/26105868a4422a476badaa9f6e0b482d to your computer and use it in GitHub Desktop.
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
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