C#.Net Interview Question and Answers

46. What is methods?
  A method is a member that implements a computation or action that can be performed by an object or class. Static methods are accessed through the class. Instance methods are accessed through instances of the class.
 
Tony Martin, said July 17, 2018
A method is a code block that contains a series of statements. A program causes the statements to be executed by calling the method and specifying any required method arguments. In C#, every executed instruction is performed in the context of a method.
Your Name Your Email-ID
Your Answer
47. What is fields?
  A field is a variable that is associated with a class or with an instance of a class.
 
Your Name Your Email-ID
Your Answer
48. What is events?
  An event is a member that enables a class or object to provide notifications. An event is declared like a field except that the declaration includes an event keyword and the type must be a delegate type.
 
Your Name Your Email-ID
Your Answer
49. What is literals and their types?
 
    Literals are value constants assigned to variables in a program. C# supports several types of literals are
  • Integer literals
  • Real literals
  • Boolean literals
  • Single character literals
  • String literals
  • Backslash character literals
 
Your Name Your Email-ID
Your Answer
50. What is the difference between value type and reference type?
 
  • Value types are stored on the stack and when a value of a variable is assigned to another variable.
  • Reference types are stored on the heap, and when an assignment between two reference variables occurs.
 
Goutami, said Jan 25,2014
Value Types : When a value of a variable is assigned to another variable then two copies of the variables are stored in the memory.
ReferenceTypes : When value of one variable assigned to another varible only reference is copied actual value remains on the same memory location.
Your Name Your Email-ID
Your Answer