twc
Posts: 129
Nickname: twc
Registered: Feb, 2004
|
|
Re: procedure
|
Posted: Mar 14, 2004 8:08 PM
|
|
Yes and No.
A method (as they are called in Java) can only return one thing. However, if that thing is an object, then, in a sense, it can return multiple items of data.
For example, a MouseEvent object is created in response to any of several mouse activities (i.e. clicking, moving, entering or exiting the space above a component). It has a method that can return a Point object that corresponds to the point where the event took place. A Point object has two fields, an x coordinate for the horizontal position, and a y coordinate for the vertical position.
So the getPoint() method is only returning one thing - a Point object. But that object contains both the x and y coordinates where the Mouse event occurred.
I hope this helps. twc
|
|