Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: keeping track of array taht holds object

  1. #1
    Member
    Join Date
    Jun 2011
    Posts
    68
    My Mood
    Cool
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Default keeping track of array taht holds object

    i need to keep track of an object array datalist ,so that when i want to store the object to it i can store it to the next available element..

    Rite now i make an object ptr.value(ptr is object of class with value as instance variable) to keep track of it,can i do something easy in java


  2. #2
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,545
    My Mood
    Grumpy
    Thanks
    0
    Thanked 167 Times in 158 Posts

    Default Re: keeping track of array taht holds object

    Store the value in an int variable. Then increment the variable each time you add an item to the array and decrement it each time you "delete" an item.

Similar Threads

  1. initialise set that holds value of array
    By dstha in forum Collections and Generics
    Replies: 1
    Last Post: September 15th, 2011, 06:16 PM
  2. Reading from ResultSet to Object and from object Object Array
    By anmaston in forum What's Wrong With My Code?
    Replies: 4
    Last Post: April 7th, 2011, 06:11 AM
  3. Applying a MIDI instrument change to a Track
    By AnkleSpankle in forum Java Theory & Questions
    Replies: 3
    Last Post: January 23rd, 2011, 03:34 PM
  4. Object array with constructor
    By thedolphin13 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: September 8th, 2010, 11:02 AM
  5. Track the user session list
    By kalees in forum Java Servlet
    Replies: 3
    Last Post: October 24th, 2009, 02:34 PM