Classes And Objects In C Sharp - Study Mode
[#136] In C#, what is the syntax to define a constructor for a class named Car that takes parameters make and model?
Correct Answer
(D) public Car(string make, string model) { }
[#137] What is the keyword used to inherit a class in C#?
Correct Answer
(A) :
[#138] In C#, what is the method called automatically when an object of a class is created?
Correct Answer
(D) Constructor
[#139] What is the purpose of encapsulation in C#?
Correct Answer
(C) To hide the internal state of an object
[#140] Name a method which has the same name as that of class and which is used to destroy objects also called automatically when application is finally on process of being getting terminated.
Correct Answer
(C) Destructor