How would you obtain the current time and difference between two times?

Showing Answers 1 - 1 of 1 Answers

we have Date class in java.util.
 
 Ex:
     java.util.Date d1=new java.util.Date();
         System.out.println(d1.getTime());
          statement 1;
          statement 2;
          statement 3;
    java.util.Date d2=new java.util.Date();
    System.out.println(d2.getTime());

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions