Sign In | Subscribe
Start learning today, and be successful in your academic & professional career. Start Today!
Loading video...
This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of Introduction to Java
  • Discussion

  • Study Guides

  • Download Lecture Slides

  • Table of Contents

  • Related Services

Bookmark and Share
Lecture Comments (11)

0 answers

Post by Robert Simon on November 9, 2015

Can I instantiate a Arraylist of Strings as follows:

List <String> ref = new ArrayList <String> (); instead of
ArrayList <String> ref = new ArrayList <String> ();

If i can instantiate an Arraylist both ways which way is better and why?

1 answer

Last reply by: Professor Quayle
Sun Apr 26, 2015 11:43 PM

Post by Bilbo Baggins on April 23, 2015

where do you write the name of the arraylist or linked list for the methods.

1 answer

Last reply by: Matthew Dunning
Sun Apr 19, 2015 12:41 AM

Post by Matthew Dunning on April 19, 2015

is adding and removing the same in the linked list ?

1 answer

Last reply by: Professor Quayle
Fri Jul 19, 2013 11:46 AM

Post by Dakoto Aya semale on July 17, 2013

im having trouble downloading the code for each lesson, any help?

1 answer

Last reply by: Professor Quayle
Thu Jan 17, 2013 1:18 AM

Post by Sara Spiegel on January 15, 2013

FYI: Linked Listed are not part of the AP Computer Science subset

1 answer

Last reply by: Professor Quayle
Mon Dec 24, 2012 5:27 PM

Post by Alex Moon on December 13, 2012

What? My eclipse makes me "import java.util.ArrayList;" when I'm trying out the exercise. is this normal?

Lists

  • A list is a collection of objects
  • A list can only store objects of a class, not primitive types
  • Wrapper classes are provided to get around this limitation
  • Lists are implemented through the List interface
  • An ArrayList implements the List interface
  • A LinkedList also implements the List interface (not in AP subset)
  • List methods you need to know are: size, add, get, set, remove

Lists

Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.

  • Intro 0:00
  • Roadmap 0:16
  • Lists 0:52
    • Wrapper Classes
  • The List Interface 2:37
    • Cannot Instantiate a List
  • The ArrayList Class 5:01
    • The Way It Works
  • The ArrayList Class 8:34
    • Primary Methods Needed To Use for ArraryList
    • Code Examples
  • The LinkedList Class 21:01
    • To Instantiate a LinkedList…
    • Code Example
  • ArrayList vs. LinkedList 25:25
    • Internal Storage Implementation of ArrayList
    • Internal Storage Implementation of LinkedList
    • Pros/Cons of Each
  • Summary 32:10