Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement