Adding multiple object in java

312 views

Published on

Adding multiple object in java

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
312
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Adding multiple object in java

  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 22 2 25 24 3 30 25 4 30 28
  3. 3. Jobs Applied # Company Designation Applied Date 1 AfiInfotec SoftwareDeveloper 21/8/2013 2 CodeLogic SoftwareDeveloper 23/8/2013 3 Current Status
  4. 4. ADDING of the presentation Title MULTIPPLE OBJECT TO ARRAYLIST IN JAVA NoushadKanniyan noushadkanniyan6@gmail.com www.facebook.com/nnunu7@gmail .com noushadkanniyan noushadkanniyan6@gmail.com 9747394754
  5. 5. CLASS BEAN • public class BeanQn { • • private String FirstName; private String LastName; • • • • • • • • • • • • • public String get FirstName() { return FirstName; } public void set FirstName(String firstname) { FirstName = firstname; } Public String getLastName(){ Return LastName; } Public void set LastName(String lastname){ LastName=lastname; } }
  6. 6. ADDING VALUES TO ARRAYLIST public class ExamBean { ArrayList<BeanQn>ExamBeen=new ArrayList<BeanQn>(); ExamBean() { BeanQn ObjBean1=new BeanQn(); ObjBean .setFirstName(“Mohn"); ObjBean.setLastName(“Palakkal"); • ExamBeen.Add(ObjBean1); BeanQn ObjBean2=new BeanQn(); ObjBean2. setFirstName(“Ramu "); ObjBean2. setLastName(“Erakkal"); ExamBeen.Add(ObjBean2); } public ArrayList<BeanQn>getList() { return ExamBeen; } }
  7. 7. RETREAVING ARRAY VALUES public static void main(String[] args) { ExamBean ObjExamBean=new ExamBean (); ArrayList NewList=ObjExamBn.getList(); int size=NewList.size(); For(int i=0;i<size;i++) { BeanQn ObjBeanQn=(BeanQn)NewList.get(i); System.out.println(ObjBeanQn.getFirstName()); System.out.println(ObjBeanQn.getLastName()); }
  8. 8. end
  9. 9. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  10. 10. 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

×