Results 1 to 4 of 4
  1. #1
    DeckardCain is offline Member
    Join Date
    Apr 2011
    Posts
    2
    Rep Power
    0

    Default I'm New to Methods

    Ok, I'm new to Java. About 3 weeks new. I'm trying to practice methods by making a mock up of an older style of RPG. I'm trying to have a user input a string; depending on what the user types, it will call a different method I'm not sure how to execute it correctly. I'm not getting any errors, so I'm sure it's all in the way it was written. I put part of my code in there. Can someone please help me. Thank you.

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Please post your code and use code tags
    [code]
    YOUR CODE HERE
    [/code]

    It will probably just be a series of if else clauses
    Java Code:
    if(string.equals("a")){
      call method one
    }
    else{
      call method two
    }
    Last edited by sunde887; 04-29-2011 at 04:39 AM.

  3. #3
    DeckardCain is offline Member
    Join Date
    Apr 2011
    Posts
    2
    Rep Power
    0

    Default

    Oh my gosh, Thank you so much man. That fixed my problem completely. You're a life saver!

  4. #4
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    You're welcome, please mark your thread solved with the thread tools at the top.

Similar Threads

  1. Replies: 8
    Last Post: 04-17-2012, 12:00 AM
  2. ugh need some serious methods help
    By jjth39347 in forum New To Java
    Replies: 32
    Last Post: 04-01-2011, 03:43 AM
  3. Methods
    By soccer_kid_6 in forum New To Java
    Replies: 15
    Last Post: 02-27-2010, 12:49 PM
  4. methods
    By blueduiker in forum New To Java
    Replies: 12
    Last Post: 02-09-2010, 04:50 PM
  5. Replies: 4
    Last Post: 04-03-2009, 07:36 AM

Posting Permissions

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