<?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>SCJP Certification &#187; default</title>
	<atom:link href="http://www.scjp-certification.com/tag/default/feed" rel="self" type="application/rss+xml" />
	<link>http://www.scjp-certification.com</link>
	<description>Sun Certified Java Programmer Certification exam essentials</description>
	<lastBuildDate>Fri, 30 Sep 2011 05:54:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>What is a constructor?</title>
		<link>http://www.scjp-certification.com/what-is-a-constructor-2.html</link>
		<comments>http://www.scjp-certification.com/what-is-a-constructor-2.html#comments</comments>
		<pubDate>Mon, 02 Nov 2009 12:04:35 +0000</pubDate>
		<dc:creator>Daisy Williams</dc:creator>
				<category><![CDATA[Java Facts]]></category>
		<category><![CDATA[constructor]]></category>
		<category><![CDATA[default]]></category>
		<category><![CDATA[final]]></category>
		<category><![CDATA[initialize]]></category>
		<category><![CDATA[object]]></category>

		<guid isPermaLink="false">http://www.scjp-certification.com/?p=343</guid>
		<description><![CDATA[A constructor provides a convenient way to initialize a newly created object at the time of its creation. A constructor...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-a-constructor-2.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-a-constructor-2.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>A constructor provides a convenient way to initialize a newly created object at the time of its creation. A constructor is automatically called emmediately after the creation of a new object, but before the new operator completes. All Java classes must have at least one constructor, either explicitly declared in the class or an implicit default constructor. They are typically used to create an object that is an instance of a class. It is written by using the following general syntax:</p>
<p><strong>[access modifier] class name([formal parameter list]) [throws clause] {<br />
   // Body of the constructor<br />
}</strong></p>
<p>where, the elements within square brackets are optional. </p>
<p>The following rules are followed before writing a constructor for a class:
<ol>
<li>It uses the name of the class in which it is defined.</li>
<li>A constructor is always written without an explicit return type, not even void. This is because the implicit return type of a class constructor is the class itself.</li>
<li>Only accessibility modifiers can be used to declared a constructor. Unlike methods, a constructor cannot be declared as abstract, static, final, native, strictfp, or synchronized.</li>
</ol>
<p>The following is an example of a constructor:</p>
<p><strong>class Book{<br />
   String name;<br />
   String author;<br />
    Rectangle(String str1, String str2){<br />
       // more code<br />
   }<br />
}</strong>  </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-a-constructor-2.html&amp;title=What%20is%20a%20constructor%3F"><img src="http://www.scjp-certification.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.scjp-certification.com/what-is-a-constructor-2.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to declare a package?</title>
		<link>http://www.scjp-certification.com/how-to-declare-a-package.html</link>
		<comments>http://www.scjp-certification.com/how-to-declare-a-package.html#comments</comments>
		<pubDate>Wed, 28 Oct 2009 12:01:53 +0000</pubDate>
		<dc:creator>Daisy Williams</dc:creator>
				<category><![CDATA[Java Facts]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[default]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[keyword]]></category>
		<category><![CDATA[package]]></category>

		<guid isPermaLink="false">http://www.scjp-certification.com/?p=321</guid>
		<description><![CDATA[The package statement is used to declare packages. The word package is a keyword in Java. This statement is not...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.scjp-certification.com%2Fhow-to-declare-a-package.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.scjp-certification.com%2Fhow-to-declare-a-package.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>The package statement is used to declare packages. The word package is a keyword in Java. This statement is not technically needed to write a complete Java program. However, if it appears, it must be the first executable statement in the program. Only comments or white spaces are allowed before a package statement. There can be only one package declaration in a program. If no package declaration appears, the class will belong to the default package. </p>
<p>For example, the following source code file defines a class named ClassA in the package named package4: </p>
<p>package package4;</p>
<p>public class ClassA{<br />
{<br />
// body code<br />
}</p>
<p>This source file will be saved with the name ClassA.java in the directory named package4.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.scjp-certification.com%2Fhow-to-declare-a-package.html&amp;title=How%20to%20declare%20a%20package%3F"><img src="http://www.scjp-certification.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.scjp-certification.com/how-to-declare-a-package.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What are the accessibility of members or variables with different modifiers?</title>
		<link>http://www.scjp-certification.com/what-are-the-accessibility-of-members-or-varaibles-with-different-modifiers.html</link>
		<comments>http://www.scjp-certification.com/what-are-the-accessibility-of-members-or-varaibles-with-different-modifiers.html#comments</comments>
		<pubDate>Tue, 22 Sep 2009 11:02:36 +0000</pubDate>
		<dc:creator>Daisy Williams</dc:creator>
				<category><![CDATA[Java Facts]]></category>
		<category><![CDATA[default]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[private]]></category>
		<category><![CDATA[protected]]></category>
		<category><![CDATA[public]]></category>

		<guid isPermaLink="false">http://www.scjp-certification.com/?p=238</guid>
		<description><![CDATA[The following table summarizes the accessibility of members in various forms: Members/Variables PrivatePublic Protected No modifier Same classYes Yes Yes...]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-are-the-accessibility-of-members-or-varaibles-with-different-modifiers.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-are-the-accessibility-of-members-or-varaibles-with-different-modifiers.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>The following table summarizes the accessibility of members in various forms: </p>
<p><TABLE BORDER=1 bordercolor='brown' cellpadding=2><TR>
<th>Members/Variables</th>
<p><TH>Private</TH><TH>Public</TH>
<th>Protected</th>
<th>No modifier</th>
<p></TR><TR><TD>Same class</TD><TD>Yes</TD>
<td>Yes </td>
<td>Yes</td>
<td>Yes</td>
<p></TR><TR> <TD>Same package subclass</TD> <TD>No</TD>
<td>Yes</td>
<td>Yes</td>
<td>Yes</td>
<p></TR><TR><TD>Same package non-subclass</TD> <TD>No</TD>
<td>Yes</td>
<td>Yes</td>
<td> Yes</td>
<p></TR><TR><TD>Different package subclass</TD><TD>No</TD>
<td> Yes</td>
<td>Yes</td>
<td>No</td>
<p></TR><TR><TD>Different package non-subclass</TD><TD>No</TD>
<td>Yes</td>
<td> No</td>
<td>No</td>
<p> </TR></TABLE>  </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-are-the-accessibility-of-members-or-varaibles-with-different-modifiers.html&amp;title=What%20are%20the%20accessibility%20of%20members%20or%20variables%20with%20different%20modifiers%3F"><img src="http://www.scjp-certification.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.scjp-certification.com/what-are-the-accessibility-of-members-or-varaibles-with-different-modifiers.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

