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.

Results 1 to 2 of 2

Thread: return from a method

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    6
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Lightbulb return from a method

    How can i return more than 1 value from method same time (except an array)???


  2. #2
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,695
    Thanks
    25
    Thanked 334 Times in 310 Posts

    Default Re: return from a method

    I don't think you can (other than creating a specialized object that simply holds the values you want to return, and then just return that object).
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  3. The Following User Says Thank You to aussiemcgr For This Useful Post:

    MHS (June 19th, 2013)

Similar Threads

  1. [SOLVED] using the return of a method to initialize an ArrayList
    By mia_tech in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 25th, 2012, 06:05 PM
  2. [SOLVED] Return all values in an ArrayList from a method
    By IanSawyer in forum Collections and Generics
    Replies: 1
    Last Post: March 28th, 2012, 10:53 AM
  3. Why I can't return two variables in one method?
    By netlync in forum Java Theory & Questions
    Replies: 3
    Last Post: January 13th, 2012, 02:39 AM
  4. Method return value(s)
    By mwr76 in forum Loops & Control Statements
    Replies: 3
    Last Post: October 2nd, 2011, 03:38 PM
  5. Ending a method that has no return type
    By Blehs in forum Java Theory & Questions
    Replies: 3
    Last Post: August 12th, 2011, 02:56 AM