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.

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

What is the keyword used in overriding

  1. virtual,override
  2. override,new
  3. new,base
  4. base,override
Question 2 Multiple Choice (Single Answer)

class test : Form {}

  1. Creates the class Test : Form
  2. Creates the class Test that inherits the class Form
  3. Creates the class form that inherits the class Test
  4. a and b
Question 3 Multiple Choice (Single Answer)

In the body of a method, C# uses the variable named_____to refer to the current object whose method is being invoked.

  1. call
  2. this
  3. do
  4. that
Question 4 Multiple Choice (Single Answer)

Which method would be used to invoke a delegate type asynchronously in C#?

  1. Invoke()
  2. StartInvoke()
  3. BeginInvoke()
  4. SetInvoke()
Question 5 Multiple Choice (Single Answer)

Which of the following datatype is not a reference type?

  1. Delegate
  2. Array
  3. Enum
  4. Class
Question 6 Multiple Choice (Single Answer)

Which element of a document's source code defines how the markup processor should interpret the tags in the source?

  1. The type of tag used
  2. The version of the markup language that the source uses
  3. The document type declaration
  4. None
Question 7 Multiple Choice (Single Answer)

Which of the following tells a markup language processor which rules to use to interpret a document?

  1. LANGUAGE tag
  2. Document type definition
  3. TYPE tag
  4. Document tag
Question 8 Multiple Choice (Single Answer)

Which of the following is the purpose of a metamarkup language?

  1. It describes the tags in existing languages
  2. It defines new markup languages
  3. It parses the code in existing markup languages
  4. All
Question 9 Multiple Choice (Multiple Answers)

Which of the following can be defined using a markup language?

  1. Programming events
  2. Text appearance
  3. Relationships between data
  4. Text structure
Question 10 Multiple Choice (Multiple Answers)

Which of the following are actual uses for XML?

  1. Data storage
  2. Database retrieval
  3. Data migration
  4. N-tier development
Question 11 True/False

You can write a Console Application or a Windows Application in C#, without using Visual Studio.

  1. True
  2. False
Question 12 Multiple Choice (Single Answer)

The Intellisense feature of Visual Studio interactively guesses, and lists all the types, methods etc. as you go on typing. How does it work?

  1. .NET Remoting Services
  2. XML
  3. Reflections
  4. Web Services
Question 13 Multiple Choice (Single Answer)

When you write using System, at the beginning of a C# Program, the meaning of System is

  1. A header file
  2. An Assembly or .dll
  3. An executable
  4. A COM Component
Question 14 Multiple Choice (Single Answer)

Which of the following is correct way to compile a C# program file.cs, and add a reference to an external assembly Vehicle.dll?

  1. csc /target:library file.cs
  2. csc /target:exe file.cs
  3. csc Vehicle.dll file.cs
  4. csc /r:Vehicle.dll file.cs
Question 15 Multiple Choice (Single Answer)

Which of the following is not true?

  1. The root class(super class) of all classes in C# is Object
  2. Constructors in C# can be static
  3. When you override <= operator, you must override >= operator
  4. If you write your own constructor in a class, C# also provides a default constructor
Question 16 Multiple Choice (Single Answer)

When you write a program in C#, it is compiled to

  1. C# Language Code
  2. Assembly Language Code
  3. Intermediate Language which CLR understands
  4. Pseudo-code
Question 17 Multiple Choice (Single Answer)

How do you make a .NET Assembly public/universally visible to all applications, so that they can share it?

  1. By registering it in Windows Registry
  2. By signing the assembly using a strong-named key and adding it to GAC
  3. By putting it in C:\Windows Folder
  4. By setting the Environment Variables
Question 18 Multiple Choice (Single Answer)

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?

  1. B, C
  2. C, B and A
  3. A, B and C
  4. Object, A, B and C
Question 19 Multiple Choice (Single Answer)

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.

  1. char * (f* (*) ))
  2. char * ( f) (()());
  3. (char) (f) (());
  4. *(char) (f) ()();
Question 20 Multiple Choice (Single Answer)

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); } } }

  1. x = 42
  2. x = 43
  3. x = 44
  4. Compilation fails