CP2 exam questions & answers 2024
CP2 exam questions & answers 2024 It is understood that the "new" keyword calls what? - ANSWER-a class constructor Which of the following lines of code would invoke this constructor: public Dog(string strName, int intAge) { } There are TWO correct answers. A. Dog myDog = new Dog(); B. Dog myDog = new Dog(string, int); C. Dog myDog = new Dog("JFK", 6); D. Dog myDog; myDog = new Dog ("Sami", 15); - ANSWER-Dog myDog = new Dog("JFK", 6); Dog myDog; myDog = new Dog ("Sami", 15); A constructor is a method. - ANSWER-True Which of the following is the best literal meaning of the word polymorphism? - ANSWER-the ability to take on many forms A constructor can be recognized because it has the __________ __________ as the class. - ANSWER-Same name Which of the following is the correct syntax to make ChildClass inherit from ParentClass in C#? class ChildClass : ParentClass
Document information
- Uploaded on
- February 10, 2024
- Number of pages
- 4
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers