Hi people, can you please help find my mistake. My code doesn't pass testing.

public class Solution
    public static void main(String[] args)
        //add your code here
        Date now = new Date(6,8,1988);
    public static class Date{
            int day ;
            int month;
            int year;
        public Date(int day, int month, int year){
            this.day= day;

asked 01 Oct, 04:43

aleksander's gravatar image

accept rate: 0%

edited 01 Oct, 04:49

Hi! In this task we need for current date

Test passed:

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

public class Solution { public static void main(String[] args) { Date date = new Date(); SimpleDateFormat format = new SimpleDateFormat("dd MM yyyy"); System.out.println(format.format(date)); } }


answered 10 Oct, 09:51

denisros's gravatar image

accept rate: 0%

edited 10 Oct, 10:10

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 01 Oct, 04:43

Seen: 104 times

Last updated: 10 Oct, 10:10