Results 1 to 3 of 3
  1. #1
    minihazard10 is offline Member
    Join Date
    Oct 2008
    Posts
    7
    Rep Power
    0

    Default Accessing return value without printing

    Hey

    I have a method that I would like to ask a question and receive an answer from the keyboard. Then, in my main method I would like to use 'if' methods depending on what the answer is from previously mentioned method. The problem is that when I try to access the return value in the main method, it goes through the whole method again, which includes re-printing the question.


    Thanks!

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,514
    Rep Power
    25

    Default

    You'll have to post the code for any help.
    You must have a loop somewhere that returns to ask the question.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Using int/int, 7/5 would return 1
    By zoe in forum New To Java
    Replies: 2
    Last Post: 12-02-2008, 11:25 AM
  2. return out of scope?
    By another_steve in forum New To Java
    Replies: 5
    Last Post: 01-28-2008, 09:34 PM
  3. if..else..return
    By mqdias in forum New To Java
    Replies: 1
    Last Post: 08-10-2007, 04:20 PM
  4. Return value of method
    By cachi in forum New To Java
    Replies: 1
    Last Post: 08-01-2007, 08:23 AM
  5. Return to try block
    By Freddie in forum New To Java
    Replies: 2
    Last Post: 05-11-2007, 08:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •