Spider Man Date Period Java Challenge

date period

In the real world, we work with Date Period very often. In any kind of system, it’s inevitable that we will need to deal with Dates. Therefore, let’s explore how to do that with Java in a fun Java Challenge!

It's time to improve your Java skills with this Spider Man Date Period Challenge

Spider Man Date Period Challenge

What will happen after the main method is executed as follows?

date period

You can also watch the full explanation video for this Java Challenge. However, I recommend you to try the challenge first and only then watch the video. Check it out:

That’s it challenger, keep breaking your Java limits and solving the Java Challenges!

Written by
Rafael del Nero
Join the discussion

2 comments
  • Hi!
    Looks like the solution text got mixed with that of another challenge:
    “The amount of time that “Forever” will be printed is indeterminate because it will depend on the time from the main thread execution.

    There are two types of threads:

    Non-daemon: the main method is executed with a non-daemon thread behind the scenes and this thread will be executed until the end.

    Daemon: it will die if all non-daemon threads have finished.

    So in this quiz, if the main method is finished, the daemon thread we created will be finished as well because all daemon threads depend on a non-daemon thread to continue its execution.”

    Thanks for the challenges!

    • Hi Raymond, thanks for the observation. I just added the right explanation for this Java Challenge. Keep breaking your limits and you are very welcome for the Java Challenges!

Stand Out as a Java Developer and Get Your Dream Job!

You will get the book by email in a few minutes after registering.