Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
HDFS >> mail # user >> Static class vs Normal Class when to use


+
Sai Sai 2013-03-28, 04:01
+
Ted Yu 2013-03-28, 04:11
Copy link to this message
-
Re: Static class vs Normal Class when to use
Hi Ted
Thanks for your help it is really appreciated.
I have gone thru the links that you have provided but i am looking for a simple exaplanation of using static classes in Hadoop/MR while
syntactically i know how the static classes and variables r referred, i am wondering if there was something more than that we use static classes.
In other words assuming static classes r loaded at the time the classes r loaded and not at the time the object is created and the timespan of objects of static classes r less than normal classes. Please let me know if this make sense and provide any additional info if you could.
Thanks again.
Sai

________________________________
 From: Ted Yu <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]; Sai Sai <[EMAIL PROTECTED]>
Sent: Thursday, 28 March 2013 9:41 AM
Subject: Re: Static class vs Normal Class when to use
 

Take a look at Effective Java 2nd edition: 
Item 22: Favor static member classes over nonstatic  

On Wed, Mar 27, 2013 at 9:05 PM, Ted Yu <[EMAIL PROTECTED]> wrote:

See http://stackoverflow.com/questions/1353309/java-static-vs-non-static-inner-class
>
>
>I believe Josh Bloch covers this in his famous book.
>
>
>
>On Wed, Mar 27, 2013 at 9:01 PM, Sai Sai <[EMAIL PROTECTED]> wrote:
>
>In some examples/articles sometimes they use:
>>public static class MyMapper 
>>
>>
>>and sometimes they use
>>
>>
>>public class MyMapper 
>>
>>
>>
>>When/why should we use static vs normal class.
>>
>>
>>ThanksSai
>
+
Ted Dunning 2013-03-28, 07:54