Calling methods from main
<p>I have a problem with calling a method. For example, I want the following program to have two methods: </p>

<ul>
<li>the first one is to check if the year is leap or not, </li>
<li>the second one is to display the number of days in the month</li>
</ul>

<p>I can't call the methods in <code>main</code>. </p>

<pre><code>import java.util.Scanner;

public class LeapYearCheck {

    public static void main(String[] args) {
        LeapYearCheck ob = new LeapYearCheck();
        ob.isLeapYear();
        ob.daysInMonth();
    }

    static void isLeapYear() {
        Scanner input = new Scanner(System.in);
        int month = input.nextInt();
        System.out.println("Enter a year: ");
        int year = input.nextInt();
        if (year % 4 == 0 || year % 400 == 0) {
            System.out.println(year + " is leap year:");
        } else {
            System.out.println(year + " is not leap year:");
        }
    }

    static void daysInMonth() {
        Scanner input = new Scanner(System.in);
        System.out.println("Enter a month :");
        int month = input.nextInt();
        int year = 0;
        if (month == 2) {
            System.out.println("There are 29 days in February: " + year + " year");
        } else if (month == 1) {
            System.out.println("The are 31 days in January " + year + " year");
        } else if (month == 2) {
            System.out.println("The are 28 days in February " + year + " year");
        } else if (month == 3) {
            System.out.println("The are 31 days in March " + year + " year");
        } else if (month == 4) {
            System.out.println("The are 30 days in April  " + year + " year");
        } else if (month == 5) {
            System.out.println("The are 31 days in May " + year + " year");
        } else if (month == 6) {
            System.out.println("The are 30 days in June  " + year + " year");
        } else if (month == 7) {
            System.out.println("The are 31 days in July  " + year + " year");
        } else if (month == 8) {
            System.out.println("The are 31 days in August " + year + " year");
        } else if (month == 9) {
            System.out.println("The are 30 days in September  " + year + " year");
        } else if (month == 10) {
            System.out.println("The are 31 days in  October " + year + " year");
        } else if (month == 11) {
            System.out.println("The are 30 days in November " + year + " year");
        } else if (month == 12) {
            System.out.println("The are 31 days in December " + year + " year");
        } else {
            System.out.println("Invalid Month, Please enter a number between 1 &amp; 12 Merci: ");
        }
    }
}
</code></pre>
