aspose file tools*
The moose likes Beginning Java and the fly likes What are method calls? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "What are method calls?" Watch "What are method calls?" New topic
Author

What are method calls?

Jake Miller
Ranch Hand

Joined: Jun 27, 2007
Posts: 43
I am working on a "problem" that says "Given the method below, which of the method calls are legal?"

The method is

an example of an answer I think is correct is: int a = calcArea(7, 12); but this is based on not really understanding what method calls are.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Jake Miller:
...an answer I think is correct is: int a = calcArea(7, 12); but this is based on not really understanding what method calls are.

That's exactly what a method call is.

You are calling a method called calcArea, passing the required int parameters of 7 and 12. The method returns an int value, and you are assigning that return value to an int variable called a.

[ August 08, 2007: Message edited by: marc weber ]

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Jake Miller
Ranch Hand

Joined: Jun 27, 2007
Posts: 43
Ok cool, I think I get it. So a method call is really just "calling a method" ie performing a method.

Quick aside, how do you put tabs in a message? Tabbing for me just goes to Add Reply, etc.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Jake Miller:
Ok cool, I think I get it. So a method call is really just "calling a method" ie performing a method.

Quick aside, how do you put tabs in a message? Tabbing for me just goes to Add Reply, etc.

Yes. Defining a method is specifying what a method should do, and calling the method is actually pressing the "go button."

I don't think you can insert tabs directly in the input box, but you can copy tabs from another source and paste them in. You can also use multiple spaces instead. Note that you will need to use Code Tags to keep leading white space intact.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What are method calls?