This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes I need help understanding some basic function calls. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "I need help understanding some basic function calls." Watch "I need help understanding some basic function calls." New topic
Author

I need help understanding some basic function calls.

David Miser
Greenhorn

Joined: Jul 22, 2013
Posts: 9
Sorry about the unspecific title, I'm having trouble wording what my issue is because I don't really understand what I'm having trouble with.

I'm currently running through the courses at programmingbydoing.com and everything is going well. Unfortunately I've run into a problem I can't get past.
THIS ONE SPECIFICALLY.

It's asking me to pass an int (lets call it currentKeys) from main() to add_keychains(). That function call will execute a few line prints and ask how many Keychains I would like to add to the total and take the user input. Somehow I have to take that and add it to the currentKeys variable that is stored in the main function (I have no idea how to do that), and then return the new total.

I'm not sure if I am simply misinterpreting what he's saying or not. I don't want to use some unintended method of doing so or use a way he hasn't taught me yet. So far I feel I genuinely understand everything he has taught so far. I understand why I have to use these things and how/when to. So I don't wanna "cheat" my way through this one, I just need help understanding it.

I'm sorry if I wasn't very clear, just ask if you need clarification on anything.
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2229
    
    7

If you read the instructions the main idea is in the add_keychain(), remove_keychain() methods. Passing an int and returning an int should give you access to the new number of keychains.

It looks like the returned number of keychains is for the view_order() and checkout() methods.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I need help understanding some basic function calls.
 
Similar Threads
Anyone else fed up with studying for SCJP 1.5?
Re: Ersin
For or While Statement?
Forwards ...
Adding Two Objects of the Same Class