c# - Understanding default access modifiers -


i confused access modifiers, thought ask couple of quick questions clarification:

is case in absence of access modifiers data members of class, default private, though class internal?

class {     int x; } 

so, int x private int x , class a internal class a?

=========================================

also, why following code not compile?

class {     protected int x; }  public class b : {} 

as documentation states, classes , structs default internal , members private.

the code won't compile because, error message state, cannot inherit less accessible class. in case child class public , parent internal.


Comments

Popular posts from this blog

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -