if false explain why these are c# questions and .net 1. T/F – Classes are refere
ID: 3708689 • Letter: I
Question
if false explain why these are c# questions and .net
1. T/F – Classes are reference types, which means a variable for any given class type can be assigned null
2. T/F – Variables that are unique to each given instance of a class are referred to as instance variables
3. T/F – static or class level variables are shared among all instances of the class
4. T/F – Static methods can only be called from instances of the class
5. T/F – Properties allow a programmer to let the compiler do the work of generating set/get methods
6. T/F – C# supports multiple inheritance
7. T/F – Methods that are designed to be overridden by derived classes should be marked with the virtual keyword
8. T/F – An ‘abstract’ base class allows you to define a function without an implementation, forcing child classes to
implement the method
9. T/F – All interface methods are public and virtual by default
10. T/F – C# does not allow a class to implement more than one interface
1. T/F – The List class provided in C# uses generics
2. T/F – A class must implement the IEnumerable<T> interface if it is to be used in a foreach loop
3. T/F – Using generic types allows the compiler to check at compile time if an invalid type of object is being used.
4. T/F – Limits can be imposed on generic types to ensure they implement an interface, extend a base class, or even
have a default constructor
5. T/F – The ICompareable<> interface is used when objects need to be compared to determine if they are less than,
equal or greater than another object of the same type
6. T/F – An Interface type can be specified as the type of argument provided to a method.
7. T/F – Instead of using generics, you can create a list of type object and rely on polymorphism.
8. T/F – An interface can define properties in addition to methods
9. T/F – An interface can implement another interface
10. T/F – C# does not allow a class to implement more than one interface
1. T/F – A static using directive allows you to reference static methods of a class without using the class name prefix.
2. T/F – Specifying a default value for a parameter allows you to make the parameter optional
3. T/F – The out and ref keywords are ways of allowing a method to return multiple values
4. T/F –The Tuple class is designed for making it easy return multiple values from a method
5. T/F – To quickly write to a file, use the WriteAllLines from the File class in the System.IO namespace.
6. T/F – When reading from text based files, all of the content is treated as strings
7. T/F – Exceptions can be caught and handled to prevent your program from crashing by using try/catch blocks
8. T/F – When you write a class, you can use exceptions to force callers to deal with problems rather than silently
continuing
9. T/F – Type pattern matching allows code to perform different actions based on what type an object is
10. T/F – When pattern matching in a switch, you should match from the most general to the most specific
Explanation / Answer
1. True
2. True
3. True
4. True
5. True
6. True
7. True
8. True
9. True
10. False
C# always to implement more than one interface
1. True
2. True
3. True
4. True
5. True
6. False
An interface method is not implemented
7. False
polymorphism is different concept compared to list
8. True
9. True
10. False
C# always to implement more than one interface
1. True
2. True
3. True
4. False
It is used to save values
5. True
6. True
7. True
8. True
9. True
10. True
**Comment for any further queries.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.