Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Method calling

 
Nagesh Vu
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am able to understand the following piece of code:


However, I have difficulty in understanding the following piece of code:


How does one decipher the following:


I understand that the execution is as follows:

which returns an object and on the returned object, getTime() is invoked.
Is my understanding correct?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You understood well. startDate.getTime(), which calls the getTime method of the Calendar class, returns a java.util.Date object. Then the getTime method of the java.util.Date class is called, which returns a long. (I guess it would be the same to call startDate.getTimeInMillis())
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic