Results 1 to 3 of 3
  1. #1
    blueduiker is offline Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    55
    Rep Power
    0

    Talking help w/ method calling

    Hey, does anyone know how to fix my code?
    I have errors on System.out.println ("Array before reversal: " + (AU.display(mainArray)));
    and
    AU.reverse(int[] mainArray);
    and
    Java Code:
    //b. Displays the values of the array using the display() method (which you must write).
        System.out.println ("Array before reversal: " + (AU.display(mainArray)));
        //c.  Reverses the values in the array using the reverse() method (which you must write).
        AU.reverse(int[] mainArray);
        System.out.println ("Array being reversed . . .");

  2. #2
    blueduiker is offline Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    55
    Rep Power
    0

    Default

    It says for the 1st problem that:
    - The static method display(int[]) from the type ArrayUtilities should be accessed in a
    static way
    what does it mean to be accessed in a static way?
    My teacher made us make all our methods static by the way, so these are accessing static methods

  3. #3
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    8

    Default

    Accessed through the class name only rather than through a variable of an instance object created through the new operator.

Similar Threads

  1. calling method from main method
    By bob_bee in forum New To Java
    Replies: 4
    Last Post: 10-02-2009, 05:30 PM
  2. Need help calling from a different method
    By Mayur in forum New To Java
    Replies: 6
    Last Post: 03-08-2009, 09:27 PM
  3. Replies: 29
    Last Post: 09-25-2008, 07:55 PM
  4. method calling?
    By frejon26 in forum New To Java
    Replies: 4
    Last Post: 01-25-2008, 03:38 AM
  5. Help with Calling a method
    By Albert in forum New To Java
    Replies: 3
    Last Post: 07-10-2007, 03:27 PM

Tags for this Thread

Posting Permissions

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