This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Method calling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Method calling" Watch "Method calling" New topic

Method calling

Nagesh Vu

Joined: Mar 18, 2010
Posts: 7

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é

Joined: Nov 24, 2005
Posts: 14688

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())

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: Method calling
It's not a secret anymore!