• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

What are method calls?

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ]
 
Jake Miller
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
reply
    Bookmark Topic Watch Topic
  • New Topic