• Like
Usage of bean class in java
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Published

Usage of bean class in java

Usage of bean class in java

Published in Education , Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
437
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
2
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • Open EmployeeBean.java fileRight click inside the file select Source->Generate Getters and Setters

Transcript

  • 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. Typing Speed Week Target Achieved 1 40 23 2 40 27 3 40 28
  • 3. Jobs Applied Week Company 1 2 3 Designation Applied Date Current Status Intel info group System Engineer 16-9-2013 Short listed Alcatel-lucent 10-9-2013 Waiting Software Engineer
  • 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. What is Java Bean • It is a reusable Software component. • A bean encapsulate many object into one object. • We can access this object from multiple places. • It provides easy maintenance. • It provide methods to set and get the values of the properties, known as getter and setter methods.
  • 6. Creation of Java bean
  • 7. Generating Getters and Setters
  • 8. Setting values for it’s properties import com.baabte.exambean; import java.util.ArrayList; public class ques { ArrayList <exambean> ques = new ArrayList<exambean>(); Public int questn(){ exambean qs1 = new exambean(); qs1.setQuestion("1. Who give music to the song Sare jahan se acha..?"); qs1.setA("A.Pandit Ravi Shankar"); qs1.setB("B.Subha lakshmi"); qs1.setC("C.AR Rahman"); qs1.setD("D.Muhammad Iqbal"); qs1.setAnswer("A"); ques.add(qs1); }
  • 9. Getting values for it’s properties public static void main(String[] args) { int count=0; boolean flag=false; ques quesObj = new ques(); ArrayList newList = quesObj.getList(); int size = newList.size(); for(int i=0;i<size;i++) { do { else if(!answer.matches("A") && !answer.matches("B") && !answer.matches("C") && !answer.matches("D") ) {flag=true; System.out.println("Invalid Entry"); flag=false; exambean beanObj=(exambean) newList.get(i); System.out.println(beanObj.getQuestion()); System.out.println(beanObj.getA()); System.out.println(beanObj.getB()); System.out.println(beanObj.getC()); System.out.println(beanObj.getD()); System.out.println("Pleas Enter Your Answer: "); Scanner ans = new Scanner(System.in); String answer= ans.nextLine().toUpperCase(); if(answer.matches(beanObj.getAnswer())){ count++; } } } } } while(flag);} System.out.println("Total Score= "+count);
  • 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