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: How to modify the property of the object stored in a list ?

  1. #1
    Junior Member
    Join Date
    Jul 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy How to modify the property of the object stored in a list ?

    I'm facing a problem in below scenario:

    List lst = tDAO.executeReport();
    lst contains list of objects and one of the objects contains the property bDate(Timestamp) which has the value 28-2-1989 00:00:00.0, now I just wants to change the value into 28-2-1989 and store it back into the List as a Timestamp. how can I do that.

    Please help.
    Last edited by Berserker.berserk; July 31st, 2014 at 05:55 AM.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,085
    My Mood
    Mellow
    Thanks
    184
    Thanked 653 Times in 640 Posts

    Default Re: How to modify the property of the object stored in a list ?

    Welcome to the Forum! Please read this topic to learn how to post code correctly and other useful tips for newcomers.

    Refer to the List API (search for it using your favorite search engine), examine the methods available there to:

    1. Find the desired entry in lst
    2. Modify it as needed

    You don't identify the type of data being stored in lst, but to change the desired element to type Timestamp may require adjustments either inside or outside of lst. Once you get some code, show that and we can be of more help.

Similar Threads

  1. Replies: 1
    Last Post: May 18th, 2013, 11:28 PM
  2. Add an object to a linked list and a database
    By a21j92 in forum JDBC & Databases
    Replies: 0
    Last Post: March 2nd, 2013, 09:09 AM
  3. Not saving object into Linked List
    By NewbieJavaProgrammer in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 21st, 2012, 05:11 PM
  4. how to compare 2 different type object list
    By enginco in forum Collections and Generics
    Replies: 3
    Last Post: April 3rd, 2012, 03:45 PM
  5. store a list/string for each object
    By tommy in forum Object Oriented Programming
    Replies: 5
    Last Post: May 28th, 2010, 09:24 AM

Tags for this Thread