Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
docu...
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

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

– ...
List implementation
• List is an interface; you can’t say new List
()
• There are two implementations:
– LinkedList gives ...
Type Of List
• ArrayList
– Array lists are created with an initial size. When
this size is exceeded, the collection is
aut...
List Operations
• Add
– Syntax
List name.add(item name);

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

• Display
– Synt...
Example
Add Operation
public class Add {

static ArrayList <Listbean> data = new ArrayList<Listbean>();
int adddata()
{
Listbean l...
Delete Operation
• int remvdata()
{
System.out.println("Enter the position of item You
want to remove: ");
Scanner rmv = n...
Display Operation
• int dispdata()
{
if(data.isEmpty())
System.out.println("The Array is Empty");
else
System.out.println(...
Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550

Start up Vil...
List manipulation in java (add,delete,view,modify)
List manipulation in java (add,delete,view,modify)
List manipulation in java (add,delete,view,modify)
Upcoming SlideShare
Loading in …5
×

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

1,133 views

Published on

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

Published in: Education, Technology, Travel
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,133
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Open EmployeeBean.java fileRight click inside the file select Source-&gt;Generate Getters and Setters
  • List manipulation in java (add,delete,view,modify)

    1. 1. 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
    2. 2. Typing Speed Week Target Achieved 1 40 24 2 40 28 3 40 29
    3. 3. 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
    4. 4. Muhammed Noufal V T muhammednoufalvt@gmail.c om www.facebook.com/vtnoufa lvt twitter.com/noufalurnappy in.linkedin.com/pub/muham med-noufal 9744003056
    5. 5. 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
    6. 6. 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 ( );
    7. 7. 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
    8. 8. List Operations • Add – Syntax List name.add(item name); • Delete – Syntax List name.remove(item name); • Display – Syntax List name.get(item name);
    9. 9. Example
    10. 10. 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; }
    11. 11. 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; }
    12. 12. 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; }
    13. 13. 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

    ×