Kevin's right and to build on it...a public static method in an instance
class often provides utility functionality to the outside which somehow
relates to the class. For example, given a User class, you might have a
public static method to say, get a user class by user id:
public class User{
private int userId...
public static User GetUserById(int userId){
}
}
A private static method in an instance class pretty much does the same, but
only exposes the functionality internally to the class. In my experience,
the need for this doesn't come up too often. I've probably used it the most
when I provider overloads of public statics and they all use the same
private static, that for some reason I don't want exposed.. Just my $0.02
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:OG**************@TK2MSFTNGP15.phx.gbl...
If I understand you correctly, you want to know the difference between a
private static method in a non-static class, and a private non-static
method in a non-static class? If I am correct in my understanding of your
question...
A non-static class is a class which requires instantiation to use. A
non-static member of a class is a member which requires an instantiation
of its host class to use. A static member of a class is a member which does
NOT require an instantiation of its host class to use.
--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
"TomislaW" <to*********@hotmail.com> wrote in message
news:uS**************@tk2msftngp13.phx.gbl... What is the purpose or difference between
private static and private method in non-static class?