Custom Collection Development Part 7 | Core Java Tutorial | Mr. Hari Krishna

Java

Video is ready, Click Here to View ×


Custom Collection Development Part 7
Internal Algorithm and Code for Removing object in Collection

** For Online Training Registration: https://goo.gl/r6kJbB ► Call: +91-8179191999

► Visit Our Website for Classroom Training:

Core Java Training

Video is ready, Click Here to View ×

► For Online Training:
https://nareshit.com/course/core-java-online-training/

————————–

► About NareshIT:

“Naresh IT is having 14+ years of experience in software training industry and the best…

6 thoughts on “Custom Collection Development Part 7 | Core Java Tutorial | Mr. Hari Krishna

  1. nice presentation. have a question, even though collection allow heterogeneous objects, is it practical to store different type of objects in collection? because eventually while retrieval, type casting required and I believe this is not possible to cast all retrieved object. any application you can think of doing this? thanks for the feedback.

  2. public void remove(int Index) {

    if (Index < 0 || Index >=size()) {

    throw new IndexOutOfBoundsException("" + Index);
    }

    while (Index < size() – 1) {

    objArray[Index] = objArray[Index + 1];

    }

    Index++;

    objArray[Index] = null;

    elementCount–;

    }
    After creating above in NITCollection class, i am accessing remove method in Test Class. it's giving below error

    Change return type of remove(..) to boolean..

    Could you please let me know

Leave a Reply to shankar dayal Cancel reply

Your email address will not be published. Required fields are marked *