Alex Rivera | Logout

When would I want to make my private class static?

Asked 2011-06-03T04:54:02.160
78

In general, are there any benefits in declaring a private class as static?

In what cases would I want to use one of the following over the other?

private static class Foo
{
    ...
}

vs

private class Foo
{
    ...
}
Edit
Report

1 Answer

0

static classes differ from ordinary classes only in that they can be accessed without their instances being created. so if you need some class to be accessable every time, use static

answered 2011-06-03T04:58:45.200

Your Answer