Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3427560
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:51:05+00:00 2026-05-18T06:51:05+00:00

Hi this code will return indexoutofboundsException and really I don’t know why? I want

  • 0

Hi
this code will return indexoutofboundsException and really I don’t know why?
I want to remove those objects from pointlist which are as the same as an object in the list.

    public void listOfExternalPoints(List<Point> list) {
    System.out.println(list.size());
    System.out.println(pointList.size());
    int n = pointList.size();
    for (int i = pointList.size() - 1; i >= 0; i--) {
        for (int j = 0; j < list.size(); j++) {
            if (pointList.get(i)==(list.get(j))) {
                pointList.remove(i);
                n--;
            }
        }
    }

}

Also the out put of println will be :

54
62

Also the exception:

Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 60, Size: 60
    at java.util.ArrayList.RangeCheck(ArrayList.java:547)
    at java.util.ArrayList.get(ArrayList.java:322)
    at ConvexHull.BlindVersion.listOfExternalPoints(BlindVersion.java:83)

thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T06:51:06+00:00Added an answer on May 18, 2026 at 6:51 am

    hey, you removed some elements from the list. So the list is smaller than it was at the beginning of the loop.

    I suggest you to use:

    pointList.removeAll(list)
    

    Or an iterator.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code that will return keyword suggestion from yahoo using the api.
I have this following code which will return all the current semesters. How do
This code $html = file_get_html('http://runkeeper.com/user/'.RUNKEEPER_ID.'/activity/'); $link1 = $html->find('.activityMonth', 0); will return the FIRST (foo,
var nextRow = tbl.tBodies[0].rows.length; var row = tbl.tBodies[0].insertRow(nextRow); row.setAttribute('ondblclick', return move_to_x_graph();); This code will
from this code will show in original color how can i change it to
I must warn you, this code will hurt your eyes, so please don't judge
The following code will return an Enumerable of dynamic objects. protected override dynamic Get(int
I have this code: $db->get()->query() Now i want the get method's return to depend
The DriverId which will be received from this code will be a number. protected
This code will submit the information from the form to a php file, everything

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.