Answers to our C sharp Exam
1. Based on your experience with C# programming, what is the major and prominent difference between the two types of application, windows application and console application?
2. Console.WriteLine(“Hello World”);
In the above code, Console is what?
Multiple Answer 2
-Namespace -Class Method None of the above
3. A static field or method can be accessed using the instance of a class that it belongs to.
True/False 2
-True False
4. Static fields work the same way as instance fields because they are automatically initialized with default values from their type.
True/False 2
True -False
5. What modifier of a method indicates that the method of the derived class overrides the method of the base class?
Fill in the Blank 3
override
6. An access modifier that indicates that only the containing type or derived types can access the member
Fill in the Blank 3
protected
7. An implicit variable set by the set accessor of a property.
Fill in the Blank 3
value
8. Two methods are said to be ________________ if they have the same name but with different parameter list.
Fill in the Blank 3
overloaded
9. This is an operator you used to allocate memory for an instance of a class.
Multiple Choice 2
-new delete malloc alloc
10. Is it possible for a constructor to call another constructor in the same class?
True/False 2
-Yes No
11. C# supports _________________inheritance.
Multiple Choice 2
-Single Multiple All of the above
12. Choose all that applies to a derived class.
Multiple Answer 6
-Can add new fields
-Inherits fields and methods defined in its base class
-Can add new methods
None of the above
13. What keyword is used to specify that a property or method is overrideable?
Fill in the Blank 3
virtual
14. This represents a subset of the entire database, cached on your machine without a continuous connection to the database.
Fill in the Blank 3
data set
15. ______________________ object allows you to send a command (typically a SQL statement or a stored procedure) to the database.
Fill in the Blank 3
DBCommand
16. What SqlCommand method executes command but does not return any output?
Multiple Choice 2
-ExecuteNonQuery() ExecuteReader() ExecuteScalar() ExecuteXmlReader()
17. What SqlCommand property allows you to add parameters to the value of your CommandText?
Fill in the Blank 3
commandtext
