Visual C# Programming

VC# Concepts

25 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

How can we prevent a class from being inherited?

  1. Declare the class as final.
  2. Declare the class as shadows.
  3. Declare the class as sealed.
  4. Declare the class as overrides.
  5. Declare the class as abstract.
Question 2 Multiple Choice (Single Answer)

Which of the following is NOT a valid assignment operator in C#?

  1. =
  2. +=
  3. *=
  4. %=
  5. /=
Question 3 Multiple Choice (Single Answer)

Which of the following members of base class are accessible to the derived class members during inheritance?

  1. Private and Public
  2. Protected and Public
  3. Private and Protected
  4. Static and Public
  5. Static and Protected
Question 4 Multiple Choice (Single Answer)

Which of the following is the root of the .NET type hierarchy?

  1. System.Object
  2. System.Type
  3. System.Console
  4. System.Enum
  5. System.Environment
Question 5 Multiple Choice (Single Answer)

Which of the following is NOT a valid .NET Exception class?

  1. IndexOutOfRangeException
  2. OverflowException
  3. ArrayMemoryException
  4. ArrayTypeMismatchException
  5. Exception
Question 6 Multiple Choice (Single Answer)

Which of the following functions is used to remove a particular item from a ListBox?

  1. DeleteAt()
  2. RemoveFrom()
  3. DeleteIndex()
  4. RemoveAt()
  5. DeleteFrom()
Question 7 Multiple Choice (Single Answer)

Which of the following statements is true?

  1. The Array values are always sorted.
  2. The default value of numeric array elements is zero.
  3. Array elements can be of integer type only.
  4. The rank of an Array is the total number of elements it can contain.
  5. An array can be resized during the runtime.
Question 8 Multiple Choice (Single Answer)

Which of the following is the correct syntax of displaying a 'Message Box' in C#?

  1. msgbox.show()
  2. MessageBox.Show()
  3. Msgbox()
  4. msgBox.show()
  5. MessageBoxShow()
Question 9 Multiple Choice (Single Answer)

Which of the following is NOT a valid C# keyword?

  1. lock
  2. volatile
  3. out
  4. namespace
  5. form
Question 10 Multiple Choice (Single Answer)

Which of the following is FALSE regarding interfaces in C#?

  1. A class can inherit a base class and can also implement one or more interfaces.
  2. An interface cannot contain the definition of a method.
  3. An interface can inherit from one or more base interfaces.
  4. An interface cannot contain an event.
  5. Interface members are by default public.
Question 11 Multiple Choice (Single Answer)

Which of the following statements is incorrect about delegate?

  1. Delegates are type-safe.
  2. Delegates are reference types.
  3. Delegates serve the same purpose as function pointers in C and pointers to member function operators in C++.
  4. Only one method can be called using a delegate.
  5. A delegate does not know about the class of the object that it references.
Question 12 Multiple Choice (Single Answer)

Which of the following is INCORRECT regarding static constructors?

  1. There can be only one static constructor in the class.
  2. The static constructor can be parameterised.
  3. It can only access the static members of the class.
  4. There should be no access modifier in static constructor definition.
  5. The static keyword is used to declare a static constructor.
Question 13 Multiple Choice (Single Answer)

Which property or method is used to assign a name to a Thread?

  1. setName()
  2. isName()
  3. Name
  4. Start()
  5. getName()
Question 14 Multiple Choice (Single Answer)

Which of the following statements is INCORRECT with reference to StringBuilder class?

  1. StringBuilder represents a mutable string of characters.
  2. StringBuilder should be used when we want to make a significant number of changes to a string.
  3. If characters are added to the StringBuilder object, its length increases at runtime.
  4. We should always use StringBuilder in place of String.
  5. We can remove characters from a StringBuilder at runtime.
Question 15 Multiple Choice (Single Answer)

Which of the following is NOT a benefit of the CLR?

  1. Garbage collection
  2. Structured exception handling
  3. Allows creation of multithreaded, scalable applications
  4. Use of delegates instead of function pointers for increased type safety and security
  5. Support for ADO.NET
Question 16 Multiple Choice (Single Answer)

What does the parameter Initial Catalog denote inside a Connection String?

  1. Database name
  2. Username
  3. Driver Name
  4. Name of RDBMS Application
  5. Project Name
Question 17 Multiple Choice (Single Answer)

What will be the output of the above code?

String str1 = Lets learn programming in C#;
String str2;
str2 = str1.Substring(5,10);
Console.WriteLine(str2);

  1. Error
  2. learn pro
  3. earn progr
  4. earn prog
  5. learn prog
Question 18 Multiple Choice (Single Answer)

Which of the above collections provide(s) an index based input/output?

1. Stack 2. Queue 3. BitArray 4. ArrayList 5. HashTable

  1. 1 and 2 only
  2. 3 and 4 only
  3. 5 only
  4. 1, 2 and 5 only
  5. All of the above
Question 19 Multiple Choice (Single Answer)

What will be the output of the above code?

for(;;)
Console.Writeline(Hello);

 

  1. Compilation Error
  2. Hello will be printed only once.
  3. Hello will not be printed even once.
  4. Hello will be printed infinite number of times.
  5. Runtime error
Question 20 Multiple Choice (Single Answer)

What can be defined as 'emphasis on the idea, qualities and properties rather than the particulars'?

  1. Generalisation
  2. Abstraction
  3. Encapsulation
  4. Object
  5. Class
Question 21 Multiple Choice (Single Answer)

Which of the following should be used to implement a 'Like a' or a 'Kind of' relationship between two entities?

  1. Polymorphism
  2. Templates
  3. Inheritance
  4. Containership
  5. Encapsulation
Question 22 Multiple Choice (Single Answer)

Which of the following is a 64-bit Integer?

  1. char
  2. long
  3. short
  4. int
  5. byte
Question 23 Multiple Choice (Single Answer)

Which of the following statements is INCORRECT with reference to functions?

  1. Function definitions can be nested.
  2. A function can only return one value at a time.
  3. To return the control from middle of a function, the return clause should be used.
  4. Function calls can be nested.
  5. Functions can be called recursively.
Question 24 Multiple Choice (Single Answer)

Which of the following can be described as a collection of data retrieved from a data source?

  1. Dataset
  2. SQLDataReader
  3. SQLDataAdapter
  4. SQLCommand
  5. SQLTransaction
Question 25 Multiple Choice (Single Answer)

What is the default value of a 'boolean' variable?

  1. 0
  2. 1
  3. True
  4. -1
  5. False