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 Object does not return the expected output

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Return Object does not return the expected output

    Hi all..

    I am writing a class (as a plugin) where the output is an object of 2 strings and one integer. When running the plugin it is expected to show the following: "Hello 2 Worlds"
    However, I just got Hello and the rest are simply skipped!!

    Here is my code

    public static Object[] helloWorlds(PluginContext context) {

    return new Object[] { "Hello", new Integer(2), "Worlds" };
    }

    Would you please help me

    Regards,


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Return Object does not return the expected output

    I'm moving this to a more appropriate forum. The Member Introductions forum is for saying hi, not for asking technical questions.

    But if you do want help, you're going to have to post an SSCCE. Mainly, how are you calling this function and what are you doing with the result?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Trying to return more than one value as object
    By mwr76 in forum Object Oriented Programming
    Replies: 3
    Last Post: September 30th, 2011, 02:09 PM
  2. [SOLVED] How to get the return of a method inside an object in an ArrayList?
    By Hallowed in forum Java Theory & Questions
    Replies: 7
    Last Post: May 1st, 2011, 10:44 PM
  3. [SOLVED] Output isn't as expected.
    By woodcutterni in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 12th, 2011, 11:55 AM
  4. how to return value ..
    By gr8mind in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 11th, 2011, 05:27 AM