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
What is the difference between ref and out parameters in c#?
write code for inserting and updating recoards in sql server database using connected architecture & records shoulds displayed in grid view ( use c# )
Why do we use struct in c#?
What are native functions?
Can you inherit multiple abstract classes in c#?
What are the Types of values mode can hold session state in web.config
Can abstract class have constructor?
What does args mean in c#?
What is difference between encapsulation and abstraction in c#?
What are Memory foot print of an exe?
What is callback function in c#?
Are c# objects passed by reference?
What is console readkey ()?
What is the use of inheritance in c#?
How many keyword present in C# language ?