public static void main(String[] args) {

        User user = new User();

        try {
        ObjectMapper objectMapper = new ObjectMapper();

        objectMapper.writeValue(new File("D:\\Java SE\\src\\json\\object\\user.json"), user);

        User user2 = objectMapper.readValue(new File("D:\\Java SE\\src\\json\\object\\user.json"), User.class);

            System.out.println(user2);

    } catch (JsonGenerationException e) {

        e.printStackTrace();

    } catch (JsonMappingException e) {

        e.printStackTrace();

    } catch (IOException e) {

        e.printStackTrace();

    }
    }