Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Date;
- class Thing {
- static Date getDate() {return new Date();}
- }
- // not importing Date here.
- public class TestUsesThing {
- public static void main(String[] args) {
- System.out.println(Thing.getDate().getTime()); // okay
- // Date date = new Date(); // naturally this wouldn't be okay
- }
- }
- Date date = new Date();
- Date d = new Date(); // a statement
- new Thing().getDate().getTime()
- Date d = new Thing().getDate();
- System.out.println( new Thing().getDate().getTime() )
- System.out.println( new Thing().getDate() )
- public java.util.Date getDate() {
- return this.date;
- }
- public Date getDate() {
Add Comment
Please, Sign In to add comment