Results 1 to 2 of 2
  1. #1
    drymsza1234 is offline Member
    Join Date
    Nov 2009
    Posts
    9
    Rep Power
    0

    Default Passing array objects

    Hello all,

    I am stuck. I need to pass array objects from my main to another class and don't know how. I'm writing a real estate listing program that starts off with a menu and the user selects an option.

    So in my main I have

    Java Code:
    	PropertyListing currentListings [] = 
    	{new PropertyListing(1001, 'H', "Barrhaven", "Bungalow", 230000),
    	 new PropertyListing(1445, 'L', "Orleans", "50 x 90 service lot", 50000),
    	 new PropertyListing(1888, 'L', "Carp", "1/4 acre", 90000),
    	 new PropertyListing(2933, 'H', "Kanata", "2 storey", 380000),
    	 new PropertyListing(2948, 'L', "Kemptville", "1/2 acre", 49000),
    	 new PropertyListing(2966, 'H', "Barrhaven", "Townhouse", 260000),
    	 new PropertyListing(2998, 'H', "Orleans", "Bungalow", 310000),
    	 new PropertyListing(3010, 'H', "Glebe", "2 storey", 980000),
    	 new PropertyListing(3011, 'H', "Riverside South", "Townhouse", 255000),
    	 new PropertyListing(3014, 'L', "Renfrew", "1 1/2 acre", 89000)};
    and was wondering how to pass the array to another class so I could use it to say,... display sold listings, etc..

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default

    You pass them like any other object, no difference.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

Similar Threads

  1. Passing Objects
    By Java_Developer in forum New To Java
    Replies: 6
    Last Post: 10-29-2009, 02:32 PM
  2. MVC passing objects
    By simo_mon in forum New To Java
    Replies: 1
    Last Post: 07-17-2009, 07:57 AM
  3. help with passing objects between classes
    By aruna1 in forum New To Java
    Replies: 7
    Last Post: 03-22-2009, 03:41 PM
  4. Passing objects in Java
    By jbostjr in forum New To Java
    Replies: 1
    Last Post: 10-30-2007, 11:15 PM
  5. Passing objects in Java
    By jbostjr in forum Advanced Java
    Replies: 1
    Last Post: 10-30-2007, 06:57 PM

Posting Permissions

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