<?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>My Workday &#187; Constractor</title>
	<atom:link href="http://www.goworkday.com/tag/constractor/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.goworkday.com</link>
	<description>Let&#039;s talk TECH</description>
	<lastBuildDate>Tue, 23 Mar 2010 03:28:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Java: Constructors</title>
		<link>http://www.goworkday.com/2009/01/17/java-constructors/</link>
		<comments>http://www.goworkday.com/2009/01/17/java-constructors/#comments</comments>
		<pubDate>Sat, 17 Jan 2009 18:40:31 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Constractor]]></category>

		<guid isPermaLink="false">http://www.goworkday.com/?p=58</guid>
		<description><![CDATA[<br/>Constructors When you create a new instance (a new object) of a class using the new keyword, a constructor for that class is called. Constructors are used to initialize the instance variables (fields) of an object. Constructors are similar to methods, but with some important differences. Constructor name is class name. A constructors must have [...]]]></description>
			<content:encoded><![CDATA[<br/><h1>Constructors</h1>
<p>When you create a new instance (a new object) of a class using the <code>new</code> keyword, a <em>constructor</em> for that class is called.  Constructors are used to initialize the instance variables (fields) of an object. Constructors are similar to methods, but with some important differences.</p>
<ul>
<li><strong>Constructor name is class name</strong>.  A constructors must have the <em>same name as the class its in</em>.</li>
<li><strong>Default constructor</strong>.  If you don&#8217;t define a constructor for a class, a <em>default parameterless constructor</em> is automatically created by the compiler.  The default constructor     calls the default parent constructor (super()) and     initializes all instance variables to default value (zero for numeric types,     null for object references, and false for booleans).</li>
<li><strong>Default constructor is created only if there are no constructors</strong>.      If you define <em>any</em> constructor for your class,     no default constructor is automatically created.     <!--     If you define a constructor with parameters, you might also want to     define a parameterless constructor so that the class can be used      in arrays????      --></li>
<li><strong>Differences between methods and constructors</strong>.
<ul>
<li>There is <em>no return type</em> given in a constructor signature (header).         The value is this object itself so there is no need to indicate a return value.</li>
<li>There is <em>no return statement</em> in the body of the constructor.</li>
<li>The <em>first line</em> of a constructor must either be a call on another         constructor in the same class (using <code>this</code>),          or a call on the superclass constructor (using <code>super</code>).         If the first line is neither of these, the compiler automatically         inserts a call to the parameterless super class constructor.</li>
</ul>
<p>These differences in syntax between a constructor and method are     sometimes hard to see when looking at the source.  It would have been     better to have had a keyword to clearly mark constructors as some     languages do.</li>
<li><strong><code>this(...)</code> &#8211; Calls another constructor in same class</strong>.       Often a constructor with few parameters will call a constructor with more      parameters, giving default values for the missing parameters.     Use <em><code>this</code> to call other constructors</em> in the same class.</li>
<li><strong><code>super(...)</code></strong>.  Use <code><em>super</em></code> to      call a constructor in a parent class.  Calling the constructor     for the superclass must be the      <em>first statement</em> in the body of a constructor.     If you are satisfied with the default constructor in the superclass,     there is no need to make a call to it because it will be supplied automatically.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.goworkday.com/2009/01/17/java-constructors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
