C# and .NET Programming Fundamentals
Test your knowledge of C# programming fundamentals, .NET framework concepts, and related topics including exception handling, inheritance, delegates, assemblies, and basic markup language concepts.
Questions
What is the keyword used in overriding
- virtual,override
- override,new
- new,base
- base,override
class test : Form {}
- Creates the class Test : Form
- Creates the class Test that inherits the class Form
- Creates the class form that inherits the class Test
- a and b
In the body of a method, C# uses the variable named_____to refer to the current object whose method is being invoked.
- call
- this
- do
- that
Which method would be used to invoke a delegate type asynchronously in C#?
- Invoke()
- StartInvoke()
- BeginInvoke()
- SetInvoke()
Which of the following datatype is not a reference type?
- Delegate
- Array
- Enum
- Class
Which element of a document's source code defines how the markup processor should interpret the tags in the source?
- The type of tag used
- The version of the markup language that the source uses
- The document type declaration
- None
Which of the following tells a markup language processor which rules to use to interpret a document?
- LANGUAGE tag
- Document type definition
- TYPE tag
- Document tag
Which of the following is the purpose of a metamarkup language?
- It describes the tags in existing languages
- It defines new markup languages
- It parses the code in existing markup languages
- All
Which of the following can be defined using a markup language?
- Programming events
- Text appearance
- Relationships between data
- Text structure
Which of the following are actual uses for XML?
- Data storage
- Database retrieval
- Data migration
- N-tier development
You can write a Console Application or a Windows Application in C#, without using Visual Studio.
- True
- False
The Intellisense feature of Visual Studio interactively guesses, and lists all the types, methods etc. as you go on typing. How does it work?
- .NET Remoting Services
- XML
- Reflections
- Web Services
When you write using System, at the beginning of a C# Program, the meaning of System is
- A header file
- An Assembly or .dll
- An executable
- A COM Component
Which of the following is correct way to compile a C# program file.cs, and add a reference to an external assembly Vehicle.dll?
- csc /target:library file.cs
- csc /target:exe file.cs
- csc Vehicle.dll file.cs
- csc /r:Vehicle.dll file.cs
Which of the following is not true?
- The root class(super class) of all classes in C# is Object
- Constructors in C# can be static
- When you override <= operator, you must override >= operator
- If you write your own constructor in a class, C# also provides a default constructor
When you write a program in C#, it is compiled to
- C# Language Code
- Assembly Language Code
- Intermediate Language which CLR understands
- Pseudo-code
How do you make a .NET Assembly public/universally visible to all applications, so that they can share it?
- By registering it in Windows Registry
- By signing the assembly using a strong-named key and adding it to GAC
- By putting it in C:\Windows Folder
- By setting the Environment Variables
Consider 3 classes A,B,C. A's child class is B, B's child class is C. Inheritance hierarchy is A->B->C. You write in Main(), C obj = new C(); In what order are the constructors called?
- B, C
- C, B and A
- A, B and C
- Object, A, B and C
How do you define a pointer to a function that returns a character pointer and receives another pointer to function that neithers takes an argument nor returns anything.
- char * (f* (*) ))
- char * ( f) (()());
- (char) (f) (());
- *(char) (f) ()();
Given: class Scoop { static int thrower() throws Exception { return 42; } public static void main(String [] args) { try { int x = thrower(); } catch (Exception e) { X++; } finally { System.out.printIn("x = " + ++x); } } }
- x = 42
- x = 43
- x = 44
- Compilation fails