5
Contributors
8
Replies
9
Views
7 Years
Discussion Span
Last Post by jwenting
0
// 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.

-1

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.

0

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

1

BJSJC: You're looking at sql.date. java.util.Date says
Date()
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.