<?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>TechieDrill &#187; class</title>
	<atom:link href="http://techiedrill.com/tag/class/feed/" rel="self" type="application/rss+xml" />
	<link>http://techiedrill.com</link>
	<description>Your World Of Technical Tutorials</description>
	<lastBuildDate>Tue, 05 Jan 2010 16:50:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Inner class within a for loop</title>
		<link>http://techiedrill.com/2009/12/inner-class-within-a-for-loop/</link>
		<comments>http://techiedrill.com/2009/12/inner-class-within-a-for-loop/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 19:03:11 +0000</pubDate>
		<dc:creator>karnamrajesh</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[for]]></category>
		<category><![CDATA[loop]]></category>

		<guid isPermaLink="false">http://techiedrill.com/?p=482</guid>
		<description><![CDATA[class Outer
{
 //int i;
 public void Display()
 {
 System.out.println(&#8221;hi&#8221;);
 
 
 for(int i=1;i&#60;=10;i++)
 { 
 
 class Inner
 {
 
 public void MethodInner()
 {
 System.out.println(&#8221;Hello&#8221;);
 }
 }
 Inner a=new Inner();
 a.MethodInner();
 }
 } 
}
public class ForRegInnerClass
{
 public static void main(String args[])
 {
 Outer ou=new Outer();
 ou.Display();
 }
}
A tricky for loop with inner class
class Outer
{
 //int [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">class Outer</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>//int i;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>public void Display()</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>System.out.println(&#8221;hi&#8221;);</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>for(int i=1;i&lt;=10;i++)</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>{<span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>class Inner</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>public void MethodInner()</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>System.out.println(&#8221;Hello&#8221;);</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Inner a=new Inner();</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>a.MethodInner();</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>}<span style="white-space: pre;"> </span></div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">public class ForRegInnerClass</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>public static void main(String args[])</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Outer ou=new Outer();</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>ou.Display();</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<p>A tricky for loop with inner class</p>
<p>class Outer</p>
<p>{</p>
<p><span style="white-space: pre;"> </span>//int i;</p>
<p><span style="white-space: pre;"> </span>public void Display()</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>System.out.println(&#8221;hi&#8221;);</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>for(int i=1;i&lt;=10;i++)</p>
<p><span style="white-space: pre;"> </span>{<span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>class Inner</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span></p>
<p><span style="white-space: pre;"> </span>public void MethodInner()</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>System.out.println(&#8221;Hello&#8221;);</p>
<p><span style="white-space: pre;"> </span>}</p>
<p><span style="white-space: pre;"> </span>}</p>
<p><span style="white-space: pre;"> </span>Inner a=new Inner();</p>
<p><span style="white-space: pre;"> </span>a.MethodInner();</p>
<p><span style="white-space: pre;"> </span>}</p>
<p><span style="white-space: pre;"> </span>}<span style="white-space: pre;"> </span></p>
<p>}</p>
<p>public class ForRegInnerClass</p>
<p>{</p>
<p><span style="white-space: pre;"> </span>public static void main(String args[])</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>Outer ou=new Outer();</p>
<p><span style="white-space: pre;"> </span>ou.Display();</p>
<p><span style="white-space: pre;"> </span>}</p>
<p>}</p>
]]></content:encoded>
			<wfw:commentRss>http://techiedrill.com/2009/12/inner-class-within-a-for-loop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Inner class</title>
		<link>http://techiedrill.com/2009/12/java-inner-class/</link>
		<comments>http://techiedrill.com/2009/12/java-inner-class/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 19:00:19 +0000</pubDate>
		<dc:creator>karnamrajesh</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[inner]]></category>

		<guid isPermaLink="false">http://techiedrill.com/?p=479</guid>
		<description><![CDATA[class Outer
{
 String s=&#8221;Welcome&#8221;;
 public void MethodInner()
 {
 Inner in=new Inner();
 in.InnerMethod();
 }
 class Inner
 {
 public void InnerMethod()
 {
 System.out.println(&#8221;Hello!&#8221;+s);
 }
 }
}
class RegInnerClass
{
 public static void main(String args[])
 {
 Outer ou=new Outer();
 ou.MethodInner();
 }
}
Classes that are defined inside another class are called inner class or nested class. Inner classes benefits in access control and naming control.
Try [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">class Outer</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>String s=&#8221;Welcome&#8221;;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>public void MethodInner()</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Inner in=new Inner();</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>in.InnerMethod();</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>class Inner</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>public void InnerMethod()</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>System.out.println(&#8221;Hello!&#8221;+s);</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">class RegInnerClass</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>public static void main(String args[])</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>{</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>Outer ou=new Outer();</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>ou.MethodInner();</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span style="white-space: pre;"> </span>}</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">}</div>
<p>Classes that are defined inside another class are called inner class or nested class. Inner classes benefits in access control and naming control.</p>
<p>Try out the below code</p>
<p>class Outer</p>
<p>{</p>
<p><span style="white-space: pre;"> </span>String s=&#8221;Welcome&#8221;;</p>
<p><span style="white-space: pre;"> </span>public void MethodInner()</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>Inner in=new Inner();</p>
<p><span style="white-space: pre;"> </span>in.InnerMethod();</p>
<p><span style="white-space: pre;"> </span>}</p>
<p><span style="white-space: pre;"> </span>class Inner</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>public void InnerMethod()</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>System.out.println(&#8221;Hello!&#8221;+s);</p>
<p><span style="white-space: pre;"> </span>}</p>
<p><span style="white-space: pre;"> </span>}</p>
<p>}</p>
<p>class RegInnerClass</p>
<p>{</p>
<p><span style="white-space: pre;"> </span>public static void main(String args[])</p>
<p><span style="white-space: pre;"> </span>{</p>
<p><span style="white-space: pre;"> </span>Outer ou=new Outer();</p>
<p><span style="white-space: pre;"> </span>ou.MethodInner();</p>
<p><span style="white-space: pre;"> </span>}</p>
<p>}</p>
]]></content:encoded>
			<wfw:commentRss>http://techiedrill.com/2009/12/java-inner-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
