提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
使用日历显示月份
import java.util.Calendar; public class Main {// 来 自 N o w J a v a . c o m - 时 代 Java public static void main(String[] args) { Calendar now = Calendar.getInstance(); System.out.println("Current date : " + (now.get(Calendar.MONTH) + 1) + "-" + now.get(Calendar.DATE) + "-" + now.get(Calendar.YEAR)); String[] strMonths = new String[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",