Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Replies
    21
    Views
    1,298

    [SOLVED] Re: Returning an array

    Not the array, the double value.
  2. Replies
    21
    Views
    1,298

    [SOLVED] Re: Returning an array

    If you're happy with 1.99 becoming 1, then you can cast the double to an int by putting (int) before it.
  3. Replies
    21
    Views
    1,298

    [SOLVED] Re: Returning an array

    Each instance has its own min value.
  4. Replies
    21
    Views
    1,298

    [SOLVED] Re: Returning an array

    That looks like an array full of references to 4 different instances.
  5. Replies
    21
    Views
    1,298

    [SOLVED] Re: Returning an array

    To call a non-static method in a class you need to get a reference to an instance of the class and use that to call the method:

    refToClass.methodInClass(); // call methodInClass using...
  6. Replies
    21
    Views
    1,298

    [SOLVED] Re: Returning an array

    Call the getMin() method.
  7. Replies
    21
    Views
    1,298

    [SOLVED] Re: Returning an array

    Have you tried making it a method?

    I don't know what rules you've been given about what goes in a "main" class and can't give you any advice.
    I put the main() method in the class that has the...
  8. Replies
    21
    Views
    1,298

    [SOLVED] Re: Returning an array

    The Arrays class's toString() method is used for debug output and rarely used to generate output for a report. You print out the contents of an array so you can see what the program has put into it....
  9. Replies
    21
    Views
    1,298

    [SOLVED] Re: Returning an array

    What does the program output now when it is executed?


    Are you asking about a method? Who will call the method? What data would the method need to do its computations? Will it need to save...
  10. Replies
    21
    Views
    1,298

    [SOLVED] Re: Returning an array

    That is what is printed out when you print an int array. It is returned by the toString() method

    To see the contents of an array, use the Arrays class's toString() method:
    ...
  11. Replies
    21
    Views
    1,298

    [SOLVED] Re: Returning an array

    Please post the output that you are talking about and a full program that compiles, executes and generates the output.
Results 1 to 11 of 11