Total members 11895 |It is currently Sun Dec 22, 2024 5:35 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





What is javaBeans?
Javabean class is a type of java classes that is follow some rules for methods and naming.

The Rules of JavaBean class:
1. The properties variables are private and accessed due the set and get methods.
2. First letter in property name must be lowercase and any start world latter must be uppercase. (ex : myName)
3. The name of setter function is set followed by the property name but every first letter is upper case. (ex: setmyName(String MyName) ) .
4. Setters and getters are public.
5. Getters have no parameter.
6. Setters have void return type.
Code:
public class FilmBean {
private String filmName;
// getter method for property filmName
public String getFilmName() {
return filmName;
}
// setter method to set the value of the property filmName
public void setFilmName(String newFilm) {
filmName = newFilm;
}


JavaBean classes (with it standards and rules ) allow the reusability of the components , and avoid creating the system from scratch ,naming conventions standards help tools to use JavaBeans componets.



_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : What is javaBeans
 What is JAVABEANS? !!!     -  
 What is Enterprise JAVABEANS? !!     -  



Topic Tags

Servlets/JSP
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com