Hey,
Regarding exercise number 1.3.
After for statement, You should check the SCOPE of "for".
This is Your scope now: { int j = i;}
rest of the program goes like a Turing machine program - one by one,
line by one - without any repetitions.
PaciorOn Aug 6, 8:27 pm, Yong Hua Lee <[email protected]> wrote: > Hello, > > I was unable to get the date/time information consistently. > > Exe 1.3: > ********************************************************************** > Date d1 = new Date(); > for (int i=0; i<10000000; i++) { int j = i;} > > Date d2 = new Date(); > > long elapsed_time = d2.getTime() - d1.getTime(); > System.out.println("That took " + elapsed_time > + " milliseconds"); > } --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
