<?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; free question</title>
	<atom:link href="http://www.scjp-certification.com/tag/free-question/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 will be the output of the following program code?</title>
		<link>http://www.scjp-certification.com/what-will-be-the-output-of-the-following-program-code-2.html</link>
		<comments>http://www.scjp-certification.com/what-will-be-the-output-of-the-following-program-code-2.html#comments</comments>
		<pubDate>Tue, 24 Nov 2009 11:43:54 +0000</pubDate>
		<dc:creator>Daisy Williams</dc:creator>
				<category><![CDATA[Java Questions]]></category>
		<category><![CDATA[exam guide]]></category>
		<category><![CDATA[free question]]></category>
		<category><![CDATA[free questions]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[SCJP]]></category>
		<category><![CDATA[study guide]]></category>

		<guid isPermaLink="false">http://www.scjp-certification.com/?p=440</guid>
		<description><![CDATA[public class Exc { public static void main(String args[]) { int x1=0; try { int x3= 100/x1; } catch(ArithmeticException e)...]]></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-will-be-the-output-of-the-following-program-code-2.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-will-be-the-output-of-the-following-program-code-2.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>public class Exc<br />
 {<br />
   public static void main(String args[])<br />
     {<br />
       int x1=0;<br />
       try {<br />
           int x3= 100/x1;<br />
          } catch(ArithmeticException e) {<br />
           System.out.println(&#8220;Illegal operation&#8221;);<br />
          } catch(RuntimeException e) {<br />
             System.out.println(&#8220;runtime error&#8221;);<br />
              return;<br />
          } catch(Exception e) {<br />
             System.out.println(&#8220;Exception found&#8221;);<br />
          } finally {<br />
             System.out.println(&#8220;Complete&#8221;);<br />
         }<br />
       System.out.println(&#8220;Successfully&#8221;);<br />
 }<br />
} </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-will-be-the-output-of-the-following-program-code-2.html&amp;title=What%20will%20be%20the%20output%20of%20the%20following%20program%20code%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-will-be-the-output-of-the-following-program-code-2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Constructors</title>
		<link>http://www.scjp-certification.com/constructors.html</link>
		<comments>http://www.scjp-certification.com/constructors.html#comments</comments>
		<pubDate>Tue, 17 Nov 2009 11:47:54 +0000</pubDate>
		<dc:creator>Daisy Williams</dc:creator>
				<category><![CDATA[Java Questions]]></category>
		<category><![CDATA[constructor]]></category>
		<category><![CDATA[exam guide]]></category>
		<category><![CDATA[free question]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[overriden]]></category>
		<category><![CDATA[question]]></category>
		<category><![CDATA[study guide]]></category>
		<category><![CDATA[super]]></category>

		<guid isPermaLink="false">http://www.scjp-certification.com/?p=418</guid>
		<description><![CDATA[If a class Student creates two student objects. Which of the following statements are true about its constructors? A: The...]]></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%2Fconstructors.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.scjp-certification.com%2Fconstructors.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>If a class Student creates two student objects.  Which of the following statements are true about its constructors?</p>
<p> A: The compiler can call to super() in any constructor that has a call to this().<br />
 B: If a constructor is not declared in the code, a default constructor will be automatically generated by the compiler.<br />
 C: Constructors can be overridden.<br />
 D: The compiler cannot call to super() in any constructor that has a call to this()</p>
<p>ANSWERS: </p>
<p>If a  <a href="http://www.scjp-certification.com/what-is-a-constructor-2.html">constructor</a> has a call to this(), the compiler will know that the constructor is not using the call to super(). A constructor can never have both a call to super() and a call to this() because one of these will be used as the first statement in the constructor. The compiler will not put a call to super() that is using a call to this().</p>
<p>If a constructor is not declared in the code, a default constructor will be automatically generated by the compiler. A constructor without any parameters is known as a default constructor. When a class is defined without any constructor, the Java compiler provides an implicit default constructor. </p>
<p>When the implicit default constructor of a class is invoked, it implicitly calls the no parameter constructor in the superclass. This action taken by a default constructor ensures that the inherited state of the object is initialized properly. In addition, it initializes all the instance variables in the object to the default value depending on their data type.</p>
<p>The default constructor of a class has the same access modifier with which the class has been declared. For example, the default constructor of a public class is implicitly given the public access. The default constructor of a protected class is implicitly given the protected access. The default constructor of a private class is implicitly given the private access. Otherwise, the default constructor has the default access implied by no access modifier.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.scjp-certification.com%2Fconstructors.html&amp;title=Constructors"><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/constructors.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

