set Next Month - Java java.util

Java examples for java.util:Month

Description

set Next Month

Demo Code


//package com.java2s;
import java.util.Calendar;

public class Main {
    public static void main(String[] argv) throws Exception {
        Calendar calendar = Calendar.getInstance();
        System.out.println(setNextMonth(calendar));
    }//  w w w  . j  a va 2 s.  co m

    public static Calendar setNextMonth(Calendar calendar) {
        calendar.add(Calendar.MONTH, 1);
        return calendar;
    }
}

Related Tutorials