Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.text.SimpleDateFormat;
import java.util.Date;

public class Main {
    public static void main(String[] args) throws Exception {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy");
        String trouble = "18?11?2003";
        String goodOne = "18-11-2003";
        Date date = simpleDateFormat.parse(goodOne);
        System.out.println(date);
        date = simpleDateFormat.parse(trouble);
        System.out.println(date);
        System.out.println(String.format("\\u%04x", (int) trouble.charAt(2)));
        System.out.println(String.format("\\u%04x", (int) goodOne.charAt(2)));

    }
}