c# - Regarding OOPS & Private class -


if class private , constructor public happen. can create instance of class or other class can extend? need know why , when people create private class public ctor?

the code like

private class lazyresource {     somebigresource _heavyobject = null;      public somebigresource lazyload     {                 {             if (_heavyobject == null)                 _heavyobject = new somebigresource();             return _heavyobject;         }     } } 

plzz guide me thanks

you can't create non-nested private class in c#.

this nested class, in case containing type can instantiate instance of it. , if lazyresource had private constructor nothing able instantiate (except static member of lazyresource itself).


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -