Fiveable
Fiveable

add(int index, E obj)

Definition

This method is used to insert an element at a specific index in an ArrayList. It shifts the existing elements to the right and increases the size of the ArrayList by one.

Related terms

get(int index): This method retrieves and returns the element at a specified index in an ArrayList.

set(int index, E obj): This method replaces the element at a specified index in an ArrayList with a new element.

remove(int index): This method removes and returns the element at a specified index in an ArrayList.

"add(int index, E obj)" appears in:

Additional resources (1)

  • AP Computer Science A - Unit 7 Overview: ArrayList

collegeable - rocket pep

Are you a college student?

  • Study guides for the entire semester

  • 200k practice questions

  • Glossary of 50k key terms - memorize important vocab


Fiveable
About Us

About Fiveable

Blog

Careers

Code of Conduct

Terms of Use

Privacy Policy

CCPA Privacy Policy

Resources

Cram Mode

AP Score Calculators

Study Guides

Practice Quizzes

Glossary

Cram Events

Merch Shop

Crisis Text Line

Help Center

Stay Connected


© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

About Us

About Fiveable

Blog

Careers

Code of Conduct

Terms of Use

Privacy Policy

CCPA Privacy Policy

Resources

Cram Mode

AP Score Calculators

Study Guides

Practice Quizzes

Glossary

Cram Events

Merch Shop

Crisis Text Line

Help Center

© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.