Results 1 to 4 of 4
  1. #1
    sivasayanth's Avatar
    sivasayanth is offline Member
    Join Date
    Dec 2007
    Posts
    20
    Rep Power
    0

    Default how to pass array in java?

    i prepared 1000 integer array, and initialized by the random numbers.
    then i want to pass that array another class (sorting) to do some algorithm.

    now, I'm in trouble how to pass the array to the sorting class?
    :confused: :confused: :confused: :confused: :confused:

  2. #2
    afsina is offline Member
    Join Date
    Jan 2008
    Posts
    24
    Rep Power
    0

    Default

    Have you written the sort method, or are you using built in Arrays.sort(int[]); method?

  3. #3
    sivasayanth's Avatar
    sivasayanth is offline Member
    Join Date
    Dec 2007
    Posts
    20
    Rep Power
    0

    Default

    i have algoritham for that sorting. so that i like to write code instead of inbuilt function.

  4. #4
    afsina is offline Member
    Join Date
    Jan 2008
    Posts
    24
    Rep Power
    0

    Default

    well, then make your sort method to accept an array of your choice. such as:
    Java Code:
    public static void mySort(int[] array) {
       .... sort it ...
    }

Similar Threads

  1. Question on how to pass text of a pulldown
    By Brucifer in forum New To Java
    Replies: 0
    Last Post: 04-03-2008, 12:23 AM
  2. Pass by ref. A work around?
    By diRisig in forum New To Java
    Replies: 0
    Last Post: 02-05-2008, 08:25 PM
  3. Cannot pass the correct property value to a form
    By piterskiy74 in forum Web Frameworks
    Replies: 0
    Last Post: 12-11-2007, 04:17 PM
  4. How to pass an html variable as an applet value
    By fred in forum Java Applets
    Replies: 1
    Last Post: 08-06-2007, 04:28 AM
  5. Replies: 1
    Last Post: 08-03-2007, 11:52 AM

Posting Permissions

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