call a method only once in entire application life time

I am trying to execute a program in which I want to create a method which will be called once and then used multiple times. Consider following example

public class SampleClass {

    public static void main(String[] args) {
        System.out.println(A.useMethodA());
        System.out.println(A.againUseMethodA());
    }
}

class A {

    public static String useMethodA() {
        return new SimpleDateFormat("yyyy-MM-dd").format(methodA());
    }

    public static String againUseMethodA() {
        return new SimpleDateFormat("EEE yyyy-MMM-dd").format(methodA());
    }

    public static Date methodA() {
        return B.createDate();
    }
}

class B {
    public static Date createDate() {
        Scanner sc = new Scanner(System.in);
        System.out.println("Enter Year");
        int year = sc.nextInt();
        System.out.println("Enter month");
        int month = sc.nextInt();
        System.out.println("Enter day");
        int date = sc.nextInt();
        Calendar calendar = Calendar.getInstance();
        calendar.set(year, month, date);
        return calendar.getTime();

    }
}

Now the problem is I have one method to set date and time. And Since it is being getting called multiple times as there are many other formats that use this date method. I do not want to repeat the console window to enter data everytime when method invokes but set only once. Is there any workaround to sort this.

Class A stores a static date and only calls B.createDate() if the stored date is null.

class A {

    private static Date theDate = null;

    // unchanged
    public static String useMethodA() { ... }
    }

    // unchanged
    public static String againUseMethodA() {... }

    public static Date methodA() {
        if (theDate == null)
        {
            theDate = B.createDate();
        }
        return theDate;
    }
}