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)

chapter11-120827115420-phpapp01.pdf
chapter11-120827115420-phpapp01.pdfchapter11-120827115420-phpapp01.pdf
chapter11-120827115420-phpapp01.pdf
AxmedMaxamuud6
 
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 Spec
Lorraine Hodder
 
Resume - Lee Cheah Boon
Resume - Lee Cheah BoonResume - Lee Cheah Boon
Resume - Lee Cheah Boon
CheahBoon Lee
 

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

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
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
KarakKing
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Recently uploaded (20)

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
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
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
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
 
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
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 

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