SlideShare a Scribd company logo
1 of 16
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;
}
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

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

Mayur_Soni_Internship for python for free
Mayur_Soni_Internship for python for freeMayur_Soni_Internship for python for free
Mayur_Soni_Internship for python for freeMayurSoni51
 
Business Analyst Series 2023 - Week 1 Session 1
Business Analyst Series 2023 -  Week 1 Session 1Business Analyst Series 2023 -  Week 1 Session 1
Business Analyst Series 2023 - Week 1 Session 1DianaGray10
 
Business Analyst Series 2023 - Week 1 Session 1
Business Analyst Series 2023 -  Week 1 Session 1Business Analyst Series 2023 -  Week 1 Session 1
Business Analyst Series 2023 - Week 1 Session 1DianaGray10
 
Chapter 11 Managing Systems Implementation .pptx
Chapter 11 Managing Systems Implementation .pptxChapter 11 Managing Systems Implementation .pptx
Chapter 11 Managing Systems Implementation .pptxAxmedMaxamuudYoonis
 
chapter11-120827115420-phpapp01.pdf
chapter11-120827115420-phpapp01.pdfchapter11-120827115420-phpapp01.pdf
chapter11-120827115420-phpapp01.pdfAxmedMaxamuud6
 
Towards an Agile Foundation for the Creation and Enactment of Software Engine...
Towards an Agile Foundation for the Creation and Enactment of Software Engine...Towards an Agile Foundation for the Creation and Enactment of Software Engine...
Towards an Agile Foundation for the Creation and Enactment of Software Engine...Brian ElvesĂŚter
 
Chapter 4 Requirements ModelInformation Technology Project Management - part ...
Chapter 4 Requirements ModelInformation Technology Project Management - part ...Chapter 4 Requirements ModelInformation Technology Project Management - part ...
Chapter 4 Requirements ModelInformation Technology Project Management - part ...AxmedMaxamuudYoonis
 
DotNetDeveloper (1)
DotNetDeveloper (1)DotNetDeveloper (1)
DotNetDeveloper (1)ashwanitrip87
 
IT Application Support Analyst Job Spec
IT Application Support Analyst Job SpecIT Application Support Analyst Job Spec
IT Application Support Analyst Job SpecLorraine Hodder
 
Student Project Management System (SPMS)
Student Project Management System (SPMS)Student Project Management System (SPMS)
Student Project Management System (SPMS)IRJET Journal
 
Development of admission management system
Development of admission management systemDevelopment of admission management system
Development of admission management systemAlokDatta76
 
Applying quality-standard (css)
Applying quality-standard (css)Applying quality-standard (css)
Applying quality-standard (css)Bong Bandola
 
Resume - Lee Cheah Boon
Resume - Lee Cheah BoonResume - Lee Cheah Boon
Resume - Lee Cheah BoonCheahBoon Lee
 
SW Project Process.pptx
SW Project Process.pptxSW Project Process.pptx
SW Project Process.pptxKarthigaiSelviS3
 

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

Mayur_Soni_Internship for python for free
Mayur_Soni_Internship for python for freeMayur_Soni_Internship for python for free
Mayur_Soni_Internship for python for free
 
Business Analyst Series 2023 - Week 1 Session 1
Business Analyst Series 2023 -  Week 1 Session 1Business Analyst Series 2023 -  Week 1 Session 1
Business Analyst Series 2023 - Week 1 Session 1
 
Business Analyst Series 2023 - Week 1 Session 1
Business Analyst Series 2023 -  Week 1 Session 1Business Analyst Series 2023 -  Week 1 Session 1
Business Analyst Series 2023 - Week 1 Session 1
 
Chapter 11 Managing Systems Implementation .pptx
Chapter 11 Managing Systems Implementation .pptxChapter 11 Managing Systems Implementation .pptx
Chapter 11 Managing Systems Implementation .pptx
 
Wcf
WcfWcf
Wcf
 
Adding multiple object in java
Adding multiple object in javaAdding multiple object in java
Adding multiple object in java
 
chapter11-120827115420-phpapp01.pdf
chapter11-120827115420-phpapp01.pdfchapter11-120827115420-phpapp01.pdf
chapter11-120827115420-phpapp01.pdf
 
Web Service
Web ServiceWeb Service
Web Service
 
Functions in javascript
Functions in javascriptFunctions in javascript
Functions in javascript
 
Towards an Agile Foundation for the Creation and Enactment of Software Engine...
Towards an Agile Foundation for the Creation and Enactment of Software Engine...Towards an Agile Foundation for the Creation and Enactment of Software Engine...
Towards an Agile Foundation for the Creation and Enactment of Software Engine...
 
Chapter 4 Requirements ModelInformation Technology Project Management - part ...
Chapter 4 Requirements ModelInformation Technology Project Management - part ...Chapter 4 Requirements ModelInformation Technology Project Management - part ...
Chapter 4 Requirements ModelInformation Technology Project Management - part ...
 
DotNetDeveloper (1)
DotNetDeveloper (1)DotNetDeveloper (1)
DotNetDeveloper (1)
 
IT Application Support Analyst Job Spec
IT Application Support Analyst Job SpecIT Application Support Analyst Job Spec
IT Application Support Analyst Job Spec
 
Student Project Management System (SPMS)
Student Project Management System (SPMS)Student Project Management System (SPMS)
Student Project Management System (SPMS)
 
Development of admission management system
Development of admission management systemDevelopment of admission management system
Development of admission management system
 
Applying quality-standard (css)
Applying quality-standard (css)Applying quality-standard (css)
Applying quality-standard (css)
 
LTB Demo - Healthcare Evaluation
LTB Demo - Healthcare EvaluationLTB Demo - Healthcare Evaluation
LTB Demo - Healthcare Evaluation
 
Resume - Lee Cheah Boon
Resume - Lee Cheah BoonResume - Lee Cheah Boon
Resume - Lee Cheah Boon
 
SW Project Process.pptx
SW Project Process.pptxSW Project Process.pptx
SW Project Process.pptx
 
Sadchap04
Sadchap04Sadchap04
Sadchap04
 

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

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

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

Recently uploaded

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 

Recently uploaded (20)

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 

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

  • 1.
  • 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; }
  • 14.
  • 15.
  • 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

  1. Open EmployeeBean.java fileRight click inside the file select Source-&gt;Generate Getters and Setters