MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;

public class MainClass {
    public static void main(String[] a) {
        Date aDate;
        DateFormat fmt = DateFormat.getDateInstance(DateFormat.FULL, Locale.US);
        try {
            aDate = fmt.parse("Saturday, July 4, 1998 ");
            System.out.println("The Date string is: " + fmt.format(aDate));
        } catch (java.text.ParseException e) {
            System.out.println(e);
        }
    }
}