<?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; package</title>
	<atom:link href="http://www.scjp-certification.com/tag/package/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>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 is an assertion?</title>
		<link>http://www.scjp-certification.com/what-is-an-assertion.html</link>
		<comments>http://www.scjp-certification.com/what-is-an-assertion.html#comments</comments>
		<pubDate>Thu, 24 Sep 2009 12:08:41 +0000</pubDate>
		<dc:creator>Daisy Williams</dc:creator>
				<category><![CDATA[Java Facts]]></category>
		<category><![CDATA[assert]]></category>
		<category><![CDATA[assertion]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[package]]></category>

		<guid isPermaLink="false">http://www.scjp-certification.com/?p=256</guid>
		<description><![CDATA[An assertion is a statement that will be evauated during the execution of a program. It returns a boolean result....]]></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-an-assertion.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-an-assertion.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>An assertion is a statement that will be evauated during the execution of a program. It returns a boolean result. If the result is true, the code executes normally and no other action takes place. This confirms that the assumed statement is true. If the result is false, an AssertionError is thrown. The assertion condition is tested using the assert keyword. The assert keyword has the following two forms:
<ul>
<li><strong>assert assertCondition;</strong><br />
Here, assertCondition is an expression that evaluates to a boolean expression.</li>
<li><strong>assert assertCondition : exp;</strong><br />
Here, an expression exp is passed to the AssertionError in case an error is thrown at runtime.</li>
</ul>
<p>An assertion can be enabled or disabled for a class or a package during runtime as follows:</p>
<ul>
<li><strong>-da ClassName or -da PackageName</strong>: This will disable the assertion for a class or a package respectively. </li>
<li><strong>-ea ClassName or -ea PackageName:</strong> This will enable the assertion for a class or a package respectively. </li>
</ul>
<p>The following code illustrates how illustrations are used:</p>
<p><strong>public class Test<br />
 {<br />
   public static void main(String[] args)<br />
     {<br />
       int x =1;<br />
       assert(x==1);<br />
       assert(x ==2) : testA();<br />
       assert(x++>1): new Test();<br />
     }<br />
   public static void testA()<br />
     {<br />
        System.out.println(&#8220;Inside the method testA&#8221;);<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-an-assertion.html&amp;title=What%20is%20an%20assertion%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-an-assertion.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

