Please help me? As I am new with Java and I have tried a lot but I am not able to pass this one. This is compiled without errors but not accepted for testing as they ask to cut down at least by half too much text and now I am unable to solve this

public class Solution
    public static void main(String[] args)

asked 22 Feb '15, 14:12

Rida%20Irfan's gravatar image

Rida Irfan
accept rate: 0%

edited 23 Feb '15, 06:24

Diego%20Carleone's gravatar image

Diego Carleone ♦♦

In the task you are asked to display only current year, not the whole date. Because the game takes place in 31st century, you need to dispay current year + 1000.

And read this:


answered 23 Feb '15, 06:23

Diego%20Carleone's gravatar image

Diego Carleone ♦♦
accept rate: 83%

It should display the current year, soo we need to get the year from calendar object by int year = Calendar.getInstance().get(Calender.YEAR); to get the 31st century, we do (year+1000)

This answer is marked "community wiki".

answered 03 Mar '15, 12:12

Nethikopula%20Divya's gravatar image

Nethikopula ...
accept rate: 0%

Tip: Replace the century of the current year with 31. You have to display a four-digit number.

If we add 2019 + 1000 it will make 3019, and it won't start with 31


answered 31 Jan, 01:56

Java_eater's gravatar image

accept rate: 0%

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]( "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: 22 Feb '15, 14:12

Seen: 4,430 times

Last updated: 31 Jan, 01:56