8 Years
Discussion Span
Last Post by jwenting
// this is overkill
Date now = new Date(System.currentTimeMillis());

Why is this overkill?

Because the default constructor for Date implicitly gets you a Date object reference referring to the system date/time at moment of creation.

Doing it like you do here is therefore redundant.


Sorry to post unrelated,but jwenting do you mind checking my java program really quick? (for an intro to java class). I have written it just wwant to confirm its right! (your private messaging is disabled so that's why I posted here. Sorry.


Student 09,

This is very bad to hijack someone else's post. Why don't you post it in a different thread? And why are you addressing directly to a particular member? Why not let the community help you?

Edited by johndoe444: n/a


BJSJC: You're looking at sql.date. java.util.Date says
Allocates a Date object and initializes it so that it represents the time at which it was allocated, measured to the nearest millisecond.

Votes + Comments
Oops! Thanks!
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.