Day14 Collections
Day14 Collections
MIN_PRIORITY =1
NORM_PRIORITY=5
MAX_PRIORITY= 10
TNS India Foundation | ‹#›
Partners in Economic Transformation
Quiz
A Processor
B Executor
C Threadable
D Runnable
A Processor
B Executor
C Threadable
D Runnable
● ArrayList in Java is a dynamic array that allows us to store multiple objects of any
class or data type.
● It is similar to an array, but there is no fixed size limit.
● ArrayList class is present in the java.util package and is commonly used for storing and
manipulating collections of objects in an arbitrary order.
● It is a resizable array that can grow or shrink in the memory whenever needed. It is
dynamically created with an initial capacity.
● It uses a dynamic array internally for storing the group of elements, objects, or data.
● ArrayList is non-synchronized.
● The collections framework reduces the development time and the burden of
designers, programmers, and users.
● Your code is easier to maintain because it provides useful data structure and
interfaces which reduce programming efforts.
● The size of the container is growable in nature.
● It implements high-performance of useful data structures and algorithms that
increase the performance.
● It enables software reuse.
A List
B Set
C Map
A List
B Set
C Map
A HashMap
B HashSet
C LinkedList
D LinkedHashSet
A HashMap
B HashSet
C LinkedList
D LinkedHashSet
Problem Statement
You are developing a Student Test Score Tracker application for a school. The application
allows teachers to enter test scores for students and keep track of their performance
throughout the academic year. The provided Java code will be a part of the application to
help teachers input test scores for each student using an array and then display the scores
using an ArrayList from Java Collections.
Input Format
The first line represents the size of array n
The next n space-separated integer represent elements inside array
Output Format
It represents elements inside array
Sample Input
5
12345
Sample Output
Elements in the ArrayList:
1
2
3
4
5