<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ankit Virparia &#187; Bean Standards</title>
	<atom:link href="http://ankit.co/tag/bean-standards/feed" rel="self" type="application/rss+xml" />
	<link>http://ankit.co</link>
	<description>A Programmer, Designer and Trainer</description>
	<lastBuildDate>Sun, 11 May 2014 04:15:47 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.0.38</generator>
	<item>
		<title>Introduction to Java Bean</title>
		<link>http://ankit.co/tutorials/java-tutorials/java-bean/introduction-to-java-bean?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=introduction-to-java-bean</link>
		<comments>http://ankit.co/tutorials/java-tutorials/java-bean/introduction-to-java-bean#comments</comments>
		<pubDate>Fri, 04 Jan 2013 06:01:08 +0000</pubDate>
		<dc:creator><![CDATA[Ankit Virparia]]></dc:creator>
				<category><![CDATA[Java Bean]]></category>
		<category><![CDATA[Bean Standards]]></category>
		<category><![CDATA[conventions]]></category>

		<guid isPermaLink="false">http://ankit.co/?p=100</guid>
		<description><![CDATA[<p>What Is a Java Bean? Java bean is a reusable class which follows certain standards in terms of syntax. Mainly bean classes are used to encapsulate many data or objects inside one object. So that that single object can be sent/stored. A JavaBean is a Java Object which is serializable(So that we can send it [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://ankit.co/tutorials/java-tutorials/java-bean/introduction-to-java-bean">Introduction to Java Bean</a> appeared first on <a rel="nofollow" href="http://ankit.co">Ankit Virparia</a>.</p>
]]></description>
				<content:encoded><![CDATA[<h2>What Is a Java Bean?</h2>
<p>Java bean is a reusable class which follows certain standards in terms of syntax. Mainly bean classes are used to encapsulate many data or objects inside one object. So that that single object can be sent/stored. A JavaBean is a Java Object which is serializable(So that we can send it over network or store it in a File), has a pubilc 0-argument constructor(Default Constructor), private variables and public getter and setter methods.</p>
<p><strong>Advantages:</strong></p>
<ul>
<li>Write Once, Use it multiple times</li>
<li>Send multiple objects within 1 object</li>
<li>Java Bean provides Data sharing architecture so that a bean can be used to receive events from other objects.</li>
<li>Many frameworks understands Bean standards and take Bean class as input</li>
</ul>
<p><strong>JavaBean conventions:</strong></p>
<ul>
<li>public default constructor</li>
<li>Variables with access protection e.g private, protected, public, default</li>
<li>Public setter and getter for each variable to assign/access the values</li>
<li>Must implement serializable interface so that object can be sent/stored</li>
</ul>
<p><strong>Example:</strong></p>
<pre class="brush: java; title: ; notranslate">
import java.io.Serializable;

public class Employee implements Serializable 
{
    private int id;
    private String name;
    private long contact;
    
    public Employee()
    {
        id = 0;
        name = &quot;&quot;;
        contact=0;        
    }

    public long getContact() {
        return contact;
    }

    public void setContact(long contact) {
        this.contact = contact;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
}
</pre>
<p>The post <a rel="nofollow" href="http://ankit.co/tutorials/java-tutorials/java-bean/introduction-to-java-bean">Introduction to Java Bean</a> appeared first on <a rel="nofollow" href="http://ankit.co">Ankit Virparia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://ankit.co/tutorials/java-tutorials/java-bean/introduction-to-java-bean/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
