Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

Using an Array from main in another class

Thread view: 
charlene.camp@gmail.com - 06 Feb 2006 03:49 GMT
I want to create an array in my main and put a bunch of different ints
in it. Then I want to make a method in a different class and use my
array in it. How do I call the array from the main class and put it
into the class I want it?
Roedy Green - 06 Feb 2006 04:26 GMT
On 5 Feb 2006 19:49:24 -0800, "charlene.camp@gmail.com"
<charlene.camp@gmail.com> wrote, quoted or indirectly quoted someone
who said :

>How do I call the array from the main class and put it
>into the class I want it?

You pass it as a parameter to a method of that other class..  If you
want to pass it to some other static method of the same class, you
could also  put a reference to it in a static variable.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

char - 07 Feb 2006 06:43 GMT
Thank you so much!


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.