Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

in c# are methods private by default?

Tags:

c#

If I have a method that does not specify its Accessibility Level will it be Private by default?

void Item_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) {     throw new NotImplementedException(); }         

Is the above method private?

like image 764
Eli Perpinyal Avatar asked May 21 '10 11:05

Eli Perpinyal


People also ask

What is %A in C?

Modulus AND assignment operator. It takes modulus using two operands and assigns the result to the left operand. C %= A is equivalent to C = C % A.

What || means in C?

C Logical Operators If c = 5 and d = 2 then, expression ((c==5) && (d>5)) equals to 0. || Logical OR. True only if either one operand is true.

What does |= mean in C++?

|= just assigns the bitwise OR of a variable with another to the one on the LHS.

What is & operator in C?

The & (bitwise AND) in C or C++ takes two numbers as operands and does AND on every bit of two numbers. The result of AND is 1 only if both bits are 1. The | (bitwise OR) in C or C++ takes two numbers as operands and does OR on every bit of two numbers. The result of OR is 1 if any of the two bits is 1.


2 Answers

It is. The general rule if you don't define any modifier is "the most restricted modifier that can be applied here is used", so private for methods, internal for top-level classes, etc.

like image 144
Julien Lebosquain Avatar answered Sep 20 '22 16:09

Julien Lebosquain


Yes, it is private.

like image 29
Femaref Avatar answered Sep 22 '22 16:09

Femaref