SlideShare a Scribd company logo
List manipulation in java (add,delete,view,modify)
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .
Ltd
Typing Speed
Week

Target Achieved

1

40

24

2

40

28

3

40

29
Jobs Applied
Week

Company

Designation

Applied Date

Current Status

1

Career port

Programmer

6-10-2013

Waiting

2

Poornam info
tech

Software Engineer

30-9-2013

Waiting

3
Muhammed Noufal V T
muhammednoufalvt@gmail.c
om
www.facebook.com/vtnoufa
lvt
twitter.com/noufalurnappy
in.linkedin.com/pub/muham
med-noufal
9744003056
Kinds of Collections
• Collection—a group of objects, called
elements
– Set—An unordered collection with no
duplicates

– SortedSet—An ordered collection with
no duplicates
– List—an ordered collection, duplicates
are allowed
List implementation
• List is an interface; you can’t say new List
()
• There are two implementations:
– LinkedList gives faster insertions and
deletions
– ArrayList gives faster random access
• Syntax:– List list = new LinkedList ( );
– List list = new ArrayList ( );
Type Of List
• ArrayList
– Array lists are created with an initial size. When
this size is exceeded, the collection is
automatically enlarged. When objects are removed,
the array may be shrunk.

• LinkedList
– LinkedList uses nodes to hold the elements. These
nodes then point to each other, thus leading to the
name "Linked" List
List Operations
• Add
– Syntax
List name.add(item name);

• Delete
– Syntax
List name.remove(item name);

• Display
– Syntax
List name.get(item name);
Example
Add Operation
public class Add {

static ArrayList <Listbean> data = new ArrayList<Listbean>();
int adddata()
{
Listbean lb =new Listbean();
Scanner li = new Scanner(System.in);
System.out.println("Enter your Item");
lb.setItem(li.next());
System.out.println("Enter your price");
lb.setPrice(li.next());
data.add(lb);
return 0;
}
Delete Operation
• int remvdata()
{
System.out.println("Enter the position of item You
want to remove: ");
Scanner rmv = new Scanner(System.in);
int x = rmv.nextInt();
data.remove(x);
return 0;
}
Display Operation
• int dispdata()
{
if(data.isEmpty())
System.out.println("The Array is Empty");
else
System.out.println("The Array Elements are: ");
for(int i=0;i< data.size();i++)
{
Listbean beanObj=(Listbean) data.get(i);
System.out.print(beanObj.getItem());
System.out.println("t"+beanObj.getPrice());
}
return 0;
}
List manipulation in java (add,delete,view,modify)
List manipulation in java (add,delete,view,modify)
Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550

Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com

NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550

More Related Content

PPTX
Sql statement,functions and joins
PPT
PPT
List in java
PPTX
U-III-part-1.pptxpart 1 of Java and hardware coding questions are answered
PDF
Linked list
PPTX
Collections - Lists & sets
PDF
java unit 4 pdf - about java collections
Sql statement,functions and joins
List in java
U-III-part-1.pptxpart 1 of Java and hardware coding questions are answered
Linked list
Collections - Lists & sets
java unit 4 pdf - about java collections

Similar to List manipulation in java (add,delete,view,modify) (20)

PPTX
oop lecture framework,list,maps,collection
PDF
LinkedList vs ArrayList in Java | Edureka
PPT
List data structure
PPT
List Data Structure
PPT
Data structures
PPTX
Lecture ............ 3 - Linked Lists.pptx
PPTX
Collections Array list
PPTX
LinkedList vs Arraylist- an in depth look at java.util.LinkedList
PDF
Week 2 - Data Structures and Algorithms
PPTX
ITS-105.pptxvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
DOCX
Collection frame work
PDF
The list interface (the java™ tutorials collections interfaces)
PPTX
LINKED LIST.pptx
PPTX
Linked list
PPTX
Data-Structures-and-Algorithms-on-Linked-Lists (1).pptx
PPTX
collection framework.pptx
DOCX
Lecture 18Dynamic Data Structures and Generics (II).docx
PPTX
Session 17 - Collections - Lists, Sets
PPTX
linked list in Data Structure, Simple and Easy Tutorial
oop lecture framework,list,maps,collection
LinkedList vs ArrayList in Java | Edureka
List data structure
List Data Structure
Data structures
Lecture ............ 3 - Linked Lists.pptx
Collections Array list
LinkedList vs Arraylist- an in depth look at java.util.LinkedList
Week 2 - Data Structures and Algorithms
ITS-105.pptxvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Collection frame work
The list interface (the java™ tutorials collections interfaces)
LINKED LIST.pptx
Linked list
Data-Structures-and-Algorithms-on-Linked-Lists (1).pptx
collection framework.pptx
Lecture 18Dynamic Data Structures and Generics (II).docx
Session 17 - Collections - Lists, Sets
linked list in Data Structure, Simple and Easy Tutorial
Ad

More from baabtra.com - No. 1 supplier of quality freshers (20)

PPTX
Agile methodology and scrum development
PDF
Acquiring new skills what you should know
PDF
Baabtra.com programming at school
PDF
99LMS for Enterprises - LMS that you will love
PPTX
Chapter 6 database normalisation
PPTX
Chapter 5 transactions and dcl statements
PPTX
Chapter 4 functions, views, indexing
PPTX
PPTX
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
PPTX
Chapter 1 introduction to sql server
PPTX
Chapter 1 introduction to sql server
Agile methodology and scrum development
Acquiring new skills what you should know
Baabtra.com programming at school
99LMS for Enterprises - LMS that you will love
Chapter 6 database normalisation
Chapter 5 transactions and dcl statements
Chapter 4 functions, views, indexing
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 1 introduction to sql server
Chapter 1 introduction to sql server
Ad

Recently uploaded (20)

PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Computing-Curriculum for Schools in Ghana
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
RMMM.pdf make it easy to upload and study
PDF
Complications of Minimal Access Surgery at WLH
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Classroom Observation Tools for Teachers
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
O7-L3 Supply Chain Operations - ICLT Program
Computing-Curriculum for Schools in Ghana
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Cell Types and Its function , kingdom of life
RMMM.pdf make it easy to upload and study
Complications of Minimal Access Surgery at WLH
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
VCE English Exam - Section C Student Revision Booklet
Module 4: Burden of Disease Tutorial Slides S2 2025
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Final Presentation General Medicine 03-08-2024.pptx
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Classroom Observation Tools for Teachers
102 student loan defaulters named and shamed – Is someone you know on the list?
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
Chapter 2 Heredity, Prenatal Development, and Birth.pdf

List manipulation in java (add,delete,view,modify)

  • 2. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 4. Jobs Applied Week Company Designation Applied Date Current Status 1 Career port Programmer 6-10-2013 Waiting 2 Poornam info tech Software Engineer 30-9-2013 Waiting 3
  • 5. Muhammed Noufal V T muhammednoufalvt@gmail.c om www.facebook.com/vtnoufa lvt twitter.com/noufalurnappy in.linkedin.com/pub/muham med-noufal 9744003056
  • 6. Kinds of Collections • Collection—a group of objects, called elements – Set—An unordered collection with no duplicates – SortedSet—An ordered collection with no duplicates – List—an ordered collection, duplicates are allowed
  • 7. List implementation • List is an interface; you can’t say new List () • There are two implementations: – LinkedList gives faster insertions and deletions – ArrayList gives faster random access • Syntax:– List list = new LinkedList ( ); – List list = new ArrayList ( );
  • 8. Type Of List • ArrayList – Array lists are created with an initial size. When this size is exceeded, the collection is automatically enlarged. When objects are removed, the array may be shrunk. • LinkedList – LinkedList uses nodes to hold the elements. These nodes then point to each other, thus leading to the name "Linked" List
  • 9. List Operations • Add – Syntax List name.add(item name); • Delete – Syntax List name.remove(item name); • Display – Syntax List name.get(item name);
  • 11. Add Operation public class Add { static ArrayList <Listbean> data = new ArrayList<Listbean>(); int adddata() { Listbean lb =new Listbean(); Scanner li = new Scanner(System.in); System.out.println("Enter your Item"); lb.setItem(li.next()); System.out.println("Enter your price"); lb.setPrice(li.next()); data.add(lb); return 0; }
  • 12. Delete Operation • int remvdata() { System.out.println("Enter the position of item You want to remove: "); Scanner rmv = new Scanner(System.in); int x = rmv.nextInt(); data.remove(x); return 0; }
  • 13. Display Operation • int dispdata() { if(data.isEmpty()) System.out.println("The Array is Empty"); else System.out.println("The Array Elements are: "); for(int i=0;i< data.size();i++) { Listbean beanObj=(Listbean) data.get(i); System.out.print(beanObj.getItem()); System.out.println("t"+beanObj.getPrice()); } return 0; }
  • 16. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550

Editor's Notes

  • #10: Open EmployeeBean.java fileRight click inside the file select Source-&gt;Generate Getters and Setters