SlideShare a Scribd company logo
Usage of bean class in java
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

23

2

40

27

3

40

28
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
Muhammed Noufal V T
muhammednoufalvt@gmail.c
om
www.facebook.com/vtnoufa
lvt
twitter.com/noufalurnappy
in.linkedin.com/pub/muham
med-noufal
9744003056
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.
Creation of Java bean
Generating Getters and Setters
Usage of bean class in java
Usage of bean class in java
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);
}
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);
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

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

PPTX
Agile methodology and scrum development
PDF
Acquiring new skills what you should know
PDF
Baabtra.com programming at school
PDF
99LMS for Enterprises - LMS that you will love
PPTX
Chapter 6 database normalisation
PPTX
Chapter 5 transactions and dcl statements
PPTX
Chapter 4 functions, views, indexing
PPTX
PPTX
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
PPTX
Chapter 1 introduction to sql server
PPTX
Chapter 1 introduction to sql server
Agile methodology and scrum development
Acquiring new skills what you should know
Baabtra.com programming at school
99LMS for Enterprises - LMS that you will love
Chapter 6 database normalisation
Chapter 5 transactions and dcl statements
Chapter 4 functions, views, indexing
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 1 introduction to sql server
Chapter 1 introduction to sql server
Ad

Recently uploaded (20)

PDF
Computing-Curriculum for Schools in Ghana
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Presentation on HIE in infants and its manifestations
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Institutional Correction lecture only . . .
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
Cell Structure & Organelles in detailed.
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
Lesson notes of climatology university.
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Computing-Curriculum for Schools in Ghana
102 student loan defaulters named and shamed – Is someone you know on the list?
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
O5-L3 Freight Transport Ops (International) V1.pdf
Presentation on HIE in infants and its manifestations
human mycosis Human fungal infections are called human mycosis..pptx
Institutional Correction lecture only . . .
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Cell Structure & Organelles in detailed.
01-Introduction-to-Information-Management.pdf
Final Presentation General Medicine 03-08-2024.pptx
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Lesson notes of climatology university.
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Module 4: Burden of Disease Tutorial Slides S2 2025
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Ad

Usage of bean class in java

  • 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 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
  • 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. 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.
  • 11. 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); }
  • 12. 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);
  • 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

Editor's Notes

  • #9: Open EmployeeBean.java fileRight click inside the file select Source-&gt;Generate Getters and Setters