Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-13-2008, 02:40 PM
sivasayanth's Avatar
Member
 
Join Date: Dec 2007
Posts: 20
sivasayanth is on a distinguished road
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?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 01-13-2008, 05:18 PM
Member
 
Join Date: Jan 2008
Posts: 24
afsina is on a distinguished road
Have you written the sort method, or are you using built in Arrays.sort(int[]); method?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 01-13-2008, 05:29 PM
sivasayanth's Avatar
Member
 
Join Date: Dec 2007
Posts: 20
sivasayanth is on a distinguished road
i have algoritham for that sorting. so that i like to write code instead of inbuilt function.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 01-13-2008, 05:33 PM
Member
 
Join Date: Jan 2008
Posts: 24
afsina is on a distinguished road
well, then make your sort method to accept an array of your choice. such as:
Code:
public static void mySort(int[] array) { .... sort it ... }
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question on how to pass text of a pulldown Brucifer New To Java 0 04-03-2008 12:23 AM
Pass by ref. A work around? diRisig New To Java 0 02-05-2008 08:25 PM
Cannot pass the correct property value to a form piterskiy74 Web Frameworks 0 12-11-2007 04:17 PM
How to pass an html variable as an applet value fred Java Applets 1 08-06-2007 04:28 AM
I can't seem to pass the value of a string variable into a string array mathias Java Applets 1 08-03-2007 11:52 AM


All times are GMT +3. The time now is 02:46 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org