- Home
- Programming
- C Sharp Programming
16.
What are two methods with the same name but with different parameters?
- A.Overloading
- B.Overriding
- C.Duplexing
- D.Duplicate
- Answer & Explanation
- Report
Answer : [A]
Explanation :
Explanation :
17.
What is the parameter in this method known as?
public void displayAbsoluteValue(int value = 1)
public void displayAbsoluteValue(int value = 1)
- A.Modified
- B.Optional
- C.Named
- D.Default
- Answer & Explanation
- Report
Answer : [B]
Explanation :
Explanation :
18.
When you create an abstract method, how do you use that method in a derived class?
- A.You must overload the method in your derived class.
- B.You must override the method in your derived class.
- C.Abstract methods cannot be used in derived classes.
- D.You need to declare the method as virtual in your derived class
- Answer & Explanation
- Report
Answer : [B]
Explanation :
Explanation :
19.
How do you enforce encapsulation on the data members of your class?
- A.Create private data members.
- B.Create private methods.
- C.Use public properties.
- D.Use private properties.
- E.Use the protected access modifier on methods, properties, and member variables.
- Answer & Explanation
- Report
Answer : [A, C]
Explanation :
Explanation :
20.
Boxing refers to:
- A.Encapsulation
- B.Converting a value type to a reference type
- C.Converting a reference type to a value type
- D.Creating a class to wrap functionality in a single entity
- Answer & Explanation
- Report
Answer : [B]
Explanation :
Explanation :