123ArticleOnline Logo
Welcome to 123ArticleOnline.com!
ALL >> Computer-Programming >> View Article

Java Bean Fully Encapsulated Class In Java

Profile Picture
By Author: Infocampus
Total Articles: 33
Comment this article
Facebook ShareTwitter ShareGoogle+ ShareTwitter Share

Introduction :
A Java Bean is a java class which is fully encapsulated that should follow following things :
- It should have a no-arg constructor.
-It should be Serializable.
-It should provide methods to set and get the values of the properties, known as getter and setter methods.
Java Bean :
Basically, a "Bean":
- is a serializable object (that is, it implements java.io.Serializable and does so correctly), that
- has "properties" whose getters and setters are just methods
- has a public default constructor (so it can be created at will and configured by setting its properties).
Why use Java Bean?
It is a reusable software component. Advanced java training in bangalore A bean encapsulates many objects into one object, so we can access this object from multiple places. And it provides the easy maintenance.
How to access the java bean class?
Methods of java bean class are private .So to access the java bean class, we should use getter and setter methods.

JavaBeans Properties :
A ...
... JavaBean property is a named attribute that can be accessed by the user of the object. The attribute can be of any Java data type, including the classes that we define. A JavaBean property may be read, write, read only, or write only.

Accessing JavaBeans Properties :
Along with action, java /j2ee classes bangalore we can use the action to access the get methods and the action to access the set methods.
JavaBeans API :
The JavaBeans functionality is provided by a set of classes and interfaces in the java.beans package.
[1] AppletInitializer : Methods in this interface are used to initialize Beans that are also applets.
[2] BeanInfo : This interface allows the developer to specify information about the events, methods and properties of a Bean.
[3] Customizer : This interface allows the developer to provide a graphical user interface through which a bean may be configured.
[4] DesignMode : Methods in this interface determine if a bean is executing in design mode.
Java training center bangalore
[5] ExceptionListener : A method in this interface is invoked when an exception has occurred.
[6] PropertyChangeListener : A method in this interface is invoked when a bound property is changed.
[7] PropertyEditor : Objects that implement this interface allow the designer to change and display property values.
[8] VetoableChangeListener : A method in this interface is invoked when a Constrained property is changed.
[9] Visibility : Methods in this interface allow a bean to execute in environments where the GUI is not available.
Advantages of Java Bean :
[1] The properties, events, and methods of a bean that are exposed to another application can be controlled. java course in bangalore
[2] A bean may register to receive events from other objects and can generate events that are sent to those other objects.
[3] Auxiliary software can be provided to help configure a java bean.
[4] The configuration settings of a bean can be saved to persistent storage and restored.

Disadvantages of JavaBean :
A class with a nullary constructor is subject to being instantiated in an invalid state. If such a class is instantiated manually by a developer (rather than automatically by some kind of framework), the developer might not realize that the class has been improperly instantiated. Best core java training in bangalore The compiler cannot detect such a problem, and even if it is documented, there is no guarantee that the developer will see the documentation.
[1] JavaBeans are inherently mutable and so lack the advantages offered by immutable objects.
[2] Having to create getters for every property and setters for many, most, or all of them can lead to an immense quantity of boilerplate code.

This is the short description about the Java Bean to get the more knowledge on Core and Advanced Java for getting a job as java developer join Infocampus Software Training Institute.

Author : Infocampus provides best Advanced Java Training in bangalore with the real time project in lesser fees . Learn struts framework , singleton class, synchronization , packages, mutlithreading etc in Core and Advanced java class. Every weekend free demo class is available for java training. Mock test and mock interviews conducted for the java course .
Join Infocampus and get 100% placement assistance for java/j2ee classes. Infocampus provides best core java training by the 10+ years experienced trainers.
To get the more details on advanced java training call at : 9738001024 or to book the seat for demo class enquire at : http://www.infocampus.co.in/java-training-bangalore.html

Total Views: 683Word Count: 777See All articles From Author

Add Comment

Computer Programming Articles

1. Reputation Management In The Digital Age: Protecting And Enhancing Your Law Firm’s Image
Author: jamewilliams

2. What Features Should I Look For In Wordpress Ecommerce Plugins?
Author: Rocket Press

3. Staying Updated With The Latest Gaming News
Author: Next Tech Plus

4. Game Development: Evolving Technologies And New Horizons
Author: Rick John

5. Why Svelte Is The Most In-demand Framework For Web Development?
Author: Why Svelte Is The Most In-Demand Framework For Web

6. Maximizing Ebay Sales With Maropost/neto And Pursuit Info Solutions
Author: rachelvander

7. The Importance Of Software Testing: Ensuring Quality In Development
Author: John Mathew

8. Sadhgurusilveroaks - The Best School In Nellore
Author: Sadhgurusilveroak

9. Website Development Using Kentico – Cloud First Headless Cms
Author: Website Development Using Kentico – Cloud First He

10. Shopify Experts In Melbourne: Elevate Your E-commerce With The Merchant Buddy
Author: themerchantbuddy

11. Web Development 3.0: Shaping The Future Of The Internet
Author: Backend Brains

12. Top College Erp In India Helps Colleges Operate More Efficiently
Author: CONTENT EDITOR FOR SAMPHIRE IT SOLUTIONS PVT LTD

13. "lcc Computer Education: Expert Java Coaching Center"
Author: Khushi Gill

14. Which Institute Is Best For Full Stack Developers In Bhopal?
Author: Shankar Singh

15. Micheal John
Author: micheal

Login To Account
Login Email:
Password:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: