Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;
import java.util.GregorianCalendar;

public class Main {
    /**
     * Liefert das Jahr in welchem das Semester begann. Dies ist besonders im Wintersemester nach dem Jahreswechsel wichtig
     *
     * @return Jahr in welchem das aktuelle Semester begann
     */
    public static int getStartYearOfSemester() {
        final Calendar calendar = GregorianCalendar.getInstance();
        if (calendar.get(Calendar.MONTH) <= Calendar.FEBRUARY)
            return calendar.get(Calendar.YEAR) - 1;
        return calendar.get(Calendar.YEAR);
    }
}