Can we define a variable with the access modifier private
in an interface?
Answer Posted / rajat
No you cannot.
1. Because an interface cannot contain fields.
2. For methods also, you cannot give an access modifier
(public / private). By default, the methods will be public
| Is This Answer Correct ? | 17 Yes | 0 No |
Post New Answer View All Answers
How do I port "synchronized" functions from visual j++ to c#?
What are the variables in c#?
What are the boolean data types in c#?
What is the implicit name of the parameter that gets passed into the set method/property of a class?
What is the difference between firstordefault and singleordefault?
What is difference between value and reference types in C#.NET
What are delegates in C#?
How does substring work in c#?
What are the 2 types of data types available in c#?
Is php better than c#?
How to implement delegates in c#.net
What is interface inheritance?
Do extension methods have to be static?
What is the use of the dispose method in C# ?
What is default method in c#?