Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Page 3 of 3 FirstFirst 123
Results 51 to 65 of 65

Thread: case

  1. #51
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: case

    Please post your code correctly using code or highlight tags which are explained near the top of this link.

  2. #52
    Member
    Join Date
    Jul 2014
    Posts
    48
    My Mood
    Confused
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: case

    Quote Originally Posted by Ada Lovelace View Post
    Whatever the value of the data is you want to return, the method
    return type should mirror that.

    Wishes Ada xx
    what do you mean by that?
    i am still learning you know...

  3. #53
    Member Ada Lovelace's Avatar
    Join Date
    May 2014
    Location
    South England UK
    Posts
    414
    My Mood
    Angelic
    Thanks
    27
    Thanked 61 Times in 55 Posts

    Default Re: case

    If I had a method called int getFood() { }
    What should the return type be?

    Wishes Ada xx
    If to Err is human - then programmers are most human of us all.
    "The Analytical Engine offers a new, a vast, and a powerful language . . .
    for the purposes of mankind
    ."
    Augusta Ada Byron, Lady Lovelace (1851)

  4. #54
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: case

    What resources are you using to learn Java? Surely they have pointed out the reasons for every item in a method's signature. Please reread your textbook, notes, or refer to online resources to learn about the method's signature, including the return type.

  5. #55
    Member
    Join Date
    Jul 2014
    Posts
    48
    My Mood
    Confused
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: case

    i want to change the int into a string and i have a specific string for the output

  6. #56
    Member Ada Lovelace's Avatar
    Join Date
    May 2014
    Location
    South England UK
    Posts
    414
    My Mood
    Angelic
    Thanks
    27
    Thanked 61 Times in 55 Posts

    Default Re: case

    i want to change the int into a string
    You have answered your own question.

    Wishes Ada xx
    If to Err is human - then programmers are most human of us all.
    "The Analytical Engine offers a new, a vast, and a powerful language . . .
    for the purposes of mankind
    ."
    Augusta Ada Byron, Lady Lovelace (1851)

  7. #57
    Member
    Join Date
    Jul 2014
    Posts
    48
    My Mood
    Confused
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: case

    please, i am having trouble and it is saying that i can't do what i'm trying to do, it is saying that the return type is void

  8. #58
    Member Ada Lovelace's Avatar
    Join Date
    May 2014
    Location
    South England UK
    Posts
    414
    My Mood
    Angelic
    Thanks
    27
    Thanked 61 Times in 55 Posts

    Default Re: case

    Look at the data type you are trying to return from
    the method - what type is that? What type have you
    declared your method to return? Do they match?

    Wishes Ada xx
    If to Err is human - then programmers are most human of us all.
    "The Analytical Engine offers a new, a vast, and a powerful language . . .
    for the purposes of mankind
    ."
    Augusta Ada Byron, Lady Lovelace (1851)

  9. #59
    Member
    Join Date
    Jul 2014
    Posts
    48
    My Mood
    Confused
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: case

    i don't know...

    --- Update ---

    i didn't set a specific one

  10. #60
    Member Ada Lovelace's Avatar
    Join Date
    May 2014
    Location
    South England UK
    Posts
    414
    My Mood
    Angelic
    Thanks
    27
    Thanked 61 Times in 55 Posts

    Default Re: case

    How much Java have you learnt, or been taught? Like
    Greg said previously, all these things are basic terminologies
    that apply to just about every programming language. Not
    being rude here - just wondering how far into the book/course
    you are at the moment.

    The bottom line is, if you, the programmer do not understand what
    and why you have written - it is almost impossible for anyone else to.
    Look at the sort of data type it is - is it a numeric, a string, a decimal?
    Does that give you a clue?

    Wishes Ada xx
    If to Err is human - then programmers are most human of us all.
    "The Analytical Engine offers a new, a vast, and a powerful language . . .
    for the purposes of mankind
    ."
    Augusta Ada Byron, Lady Lovelace (1851)

  11. #61
    Member
    Join Date
    Jul 2014
    Posts
    48
    My Mood
    Confused
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: case

    it is numeric to string,

    btw i am on the fourth chapter in the book

  12. #62
    Member Ada Lovelace's Avatar
    Join Date
    May 2014
    Location
    South England UK
    Posts
    414
    My Mood
    Angelic
    Thanks
    27
    Thanked 61 Times in 55 Posts

    Default Re: case

    Sorry I am confused now...

    Is that the data you want to change from and to or
    is that the type of data you want the method to return?

    Wishes Ada xx
    If to Err is human - then programmers are most human of us all.
    "The Analytical Engine offers a new, a vast, and a powerful language . . .
    for the purposes of mankind
    ."
    Augusta Ada Byron, Lady Lovelace (1851)

  13. #63
    Member
    Join Date
    Jul 2014
    Posts
    48
    My Mood
    Confused
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: case

    i want have int changed into a string so that i is one instead of 1

  14. #64
    Member Ada Lovelace's Avatar
    Join Date
    May 2014
    Location
    South England UK
    Posts
    414
    My Mood
    Angelic
    Thanks
    27
    Thanked 61 Times in 55 Posts

    Default Re: case

    Quote Originally Posted by lucas29 View Post
    i want have int changed into a string so that i is one instead of 1
    Will that have any effect on the return type error you were getting previously?
    Is it me or are we going round in circles in this thread? I am certain you asked
    this exact question near the beginning. Take a look at previous posts, it has
    been answered before.

    Wishes Ada xx
    If to Err is human - then programmers are most human of us all.
    "The Analytical Engine offers a new, a vast, and a powerful language . . .
    for the purposes of mankind
    ."
    Augusta Ada Byron, Lady Lovelace (1851)

  15. #65
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: case

    This thread is being closed for the following reasons:

    1. No progress has been made
    2. The OP is not posting code in code/highlight tags
    3. The conversation has deteriorated to recursion with no exit
    4. The OP is not participating in the solution; not demonstrating effort.

    @lucas29: You are welcome to begin a new thread but PLEASE observe the following hints - your own personal "Starting a thread 101:"

    1. Give the new thread a descriptive title (Suggestion for this topic: "Help changing numerals to English").
    2. Describe your assignment in as much detail as needed for someone to understand what you're trying to do.
    3. Post the commented code you've written so far in code or highlight tags (explained near the top of this link). Preferably, the posted code will be compilable and runnable.
    4. Ask specific questions, post error messages you need help with, and/or post sample runs copied from your console that demonstrate how to duplicate the problems and errors you require help to fix.

    New threads that don't observe these guidelines will not be accepted. Once you've posted as I've described above and you receive responses:

    1. Read the responses completely and try to apply the advice given.
    2. If you do not understand the advice given or how to apply it, ask questions until you do understand (return to step 1). Otherwise, continue to Step 3.
    3. If you still need help after applying the advice given, post updated code and ask NEW questions, NOT the same ones over and over again.
    4. Do not post the same message over and over again, as in "i want to change the int into a string."

    When you deviate from the above recipe, the new thread will be closed, and you will not be invited to return. This or future action is not intended to be mean or an indication that we don't like you but because we want you to get the help you need, and you're not getting it here. You have to be a contributing participant in the process. We can't do it for you.

    If you are simply unable to move forward, I highly recommend you take advantage of the instructor's office hours or use the TAs as much as possible. It's important that they see you're struggling and need extra help.

    Good luck!

    Thread closed.

Page 3 of 3 FirstFirst 123

Similar Threads

  1. case 3
    By ericgomez in forum What's Wrong With My Code?
    Replies: 2
    Last Post: August 31st, 2013, 06:21 PM
  2. switch case
    By viyyapu harsha in forum What's Wrong With My Code?
    Replies: 2
    Last Post: June 24th, 2013, 12:03 AM
  3. Need help with switch case
    By niko25 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 18th, 2012, 12:10 AM
  4. Please help me with my Case Study
    By dalexquisite in forum Object Oriented Programming
    Replies: 2
    Last Post: September 26th, 2012, 11:58 PM
  5. [SOLVED] upper case
    By andaji in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 13th, 2010, 11:54 PM