<?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; abstract</title>
	<atom:link href="http://www.scjp-certification.com/tag/abstract/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 an abstract class?</title>
		<link>http://www.scjp-certification.com/what-is-an-abstract-class.html</link>
		<comments>http://www.scjp-certification.com/what-is-an-abstract-class.html#comments</comments>
		<pubDate>Fri, 16 Oct 2009 12:28:56 +0000</pubDate>
		<dc:creator>Daisy Williams</dc:creator>
				<category><![CDATA[Java Facts]]></category>
		<category><![CDATA[abstract]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[objects]]></category>

		<guid isPermaLink="false">http://www.scjp-certification.com/?p=298</guid>
		<description><![CDATA[An abstract class is a class that is partially implemented. It provides design convenience. An abstract class consists of one...]]></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-abstract-class.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-is-an-abstract-class.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>An abstract class is a class that is partially implemented. It provides design convenience. An abstract class consists of one or more abstract methods that are declared but left unimplemented. It is the responsibility of subclasses that extend an abstract class to implement the unimplemented part of the abstract class. As the implementation of an abstract class is not complete, it is not possible to directly create objects of an abstract class. </p>
<p>A class containing one or more abstract methods must be declared as abstract. However, a class can also be declared as abstract even if it has no abstract methods. An abstract class may also have non-abstract methods.</p>
<p>Note: The final and abstract class modifiers are not used in combination.</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-abstract-class.html&amp;title=What%20is%20an%20abstract%20class%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-abstract-class.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What will happen if we inherit an abstract class?</title>
		<link>http://www.scjp-certification.com/what-will-happen-if-we-inherit-an-abstract-class.html</link>
		<comments>http://www.scjp-certification.com/what-will-happen-if-we-inherit-an-abstract-class.html#comments</comments>
		<pubDate>Mon, 14 Sep 2009 12:12:12 +0000</pubDate>
		<dc:creator>Daisy Williams</dc:creator>
				<category><![CDATA[Java Facts]]></category>
		<category><![CDATA[abstract]]></category>
		<category><![CDATA[extends]]></category>
		<category><![CDATA[inheritence]]></category>
		<category><![CDATA[method]]></category>

		<guid isPermaLink="false">http://www.scjp-certification.com/?p=198</guid>
		<description><![CDATA[abstract class Ques0347A{ int x; int init(){ x = 15; return x; } abstract void disp(); } public class Ques0347...]]></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-happen-if-we-inherit-an-abstract-class.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.scjp-certification.com%2Fwhat-will-happen-if-we-inherit-an-abstract-class.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>abstract class Ques0347A{<br />
   int x;<br />
   int init(){<br />
                x = 15;<br />
                return x;<br />
               }<br />
   abstract void disp();<br />
   }</p>
<p>   public class Ques0347 extends Ques0347A{<br />
   void disp(){<br />
                 int y = init();<br />
                 System.out.println(y);<br />
  }<br />
  public static void main(String[] argv) {<br />
      Ques0347 ob = new Ques0347();<br />
        ob.disp();<br />
   }<br />
}</strong></p>
<p>An <a href="http://www.scjp-certification.com/7-key-points-about-abstract-classes-and-methods.html"><strong>abstract</strong></a> class can be inherited as same as a simple class by using the extends clause. In the given code, there are two classes named Ques0347A and Ques0347. The Ques0347A class is declared as abstract because it contains a declaration of an abstract method named disp. It also contains an instance variable x and an instance method init(). </p>
<p>The extends clause in the declaration of the Ques0347 class suggests that it is a subclass of the abstract class Ques0347A. As the Ques0347 class provides an implementation of the disp() method, it is not declared as abstract. Ques0347 being a subclass of the Ques0347A class inherits the init() method and the variable x.</p>
<p>Hence, it is necessary of we inherit an abstract class then the sublcass will implement all the methods that are left unimplemented in the superclass. </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-happen-if-we-inherit-an-abstract-class.html&amp;title=What%20will%20happen%20if%20we%20inherit%20an%20abstract%20class%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-happen-if-we-inherit-an-abstract-class.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>7 key points about abstract classes and methods.</title>
		<link>http://www.scjp-certification.com/7-key-points-about-abstract-classes-and-methods.html</link>
		<comments>http://www.scjp-certification.com/7-key-points-about-abstract-classes-and-methods.html#comments</comments>
		<pubDate>Mon, 24 Aug 2009 12:13:34 +0000</pubDate>
		<dc:creator>Daisy Williams</dc:creator>
				<category><![CDATA[Java Facts]]></category>
		<category><![CDATA[abstract]]></category>
		<category><![CDATA[abstract class]]></category>
		<category><![CDATA[abstract method]]></category>
		<category><![CDATA[keyword]]></category>

		<guid isPermaLink="false">http://www.scjp-certification.com/?p=80</guid>
		<description><![CDATA[If a class does not implement any or all of an interface method, then it should be declared as abstract....]]></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%2F7-key-points-about-abstract-classes-and-methods.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.scjp-certification.com%2F7-key-points-about-abstract-classes-and-methods.html&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<ol>
<li> If a class does not implement any or all of an interface method, then it should be declared as abstract.</li>
<li>An abstract class is made up of one or more abstract methods that are declared but left unimplemented. </li>
<li>Abstract classes cannot be instantiated, but they can be subclassed.</li>
<li>When an abstract class is subclassed, the subclass usually provides implementations for all of the abstract methods in its parent class. However, if it does not, the subclass must also be declared abstract.</li>
<li> A class containing one or more abstract methods must be declared as abstract. However, a class can also be declared as abstract even if it has no abstract methods.</li>
<li>The final and abstract class modifiers are not used in combination.</li>
<li>An abstract method is a method that is not defined in the class in which it is declared. Instead, the method definition is deferred to one or more subclasses. An abstract method only has a semicolon after the method name and parenthetical argument list. The subclasses provide the body of the abstract method. </li>
</ol>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.scjp-certification.com%2F7-key-points-about-abstract-classes-and-methods.html&amp;title=7%20key%20points%20about%20abstract%20classes%20and%20methods."><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/7-key-points-about-abstract-classes-and-methods.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

