hadoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sai Sai <saigr...@yahoo.in>
Subject Re: Static class vs Normal Class when to use
Date Thu, 28 Mar 2013 05:01:05 GMT
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 <yuzhihong@gmail.com>
To: user@hadoop.apache.org; Sai Sai <saigraph@yahoo.in> 
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 <yuzhihong@gmail.com> 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 <saigraph@yahoo.in> 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
>
Mime
View raw message