Questions
How can we prevent a class from being inherited?
- Declare the class as final.
- Declare the class as shadows.
- Declare the class as sealed.
- Declare the class as overrides.
- Declare the class as abstract.
Which of the following is NOT a valid assignment operator in C#?
- =
- +=
- *=
- %=
- /=
Which of the following members of base class are accessible to the derived class members during inheritance?
- Private and Public
- Protected and Public
- Private and Protected
- Static and Public
- Static and Protected
Which of the following is the root of the .NET type hierarchy?
- System.Object
- System.Type
- System.Console
- System.Enum
- System.Environment
Which of the following is NOT a valid .NET Exception class?
- IndexOutOfRangeException
- OverflowException
- ArrayMemoryException
- ArrayTypeMismatchException
- Exception
Which of the following functions is used to remove a particular item from a ListBox?
- DeleteAt()
- RemoveFrom()
- DeleteIndex()
- RemoveAt()
- DeleteFrom()
Which of the following statements is true?
- The Array values are always sorted.
- The default value of numeric array elements is zero.
- Array elements can be of integer type only.
- The rank of an Array is the total number of elements it can contain.
- An array can be resized during the runtime.
Which of the following is the correct syntax of displaying a 'Message Box' in C#?
- msgbox.show()
- MessageBox.Show()
- Msgbox()
- msgBox.show()
- MessageBoxShow()
Which of the following is NOT a valid C# keyword?
- lock
- volatile
- out
- namespace
- form
Which of the following is FALSE regarding interfaces in C#?
- A class can inherit a base class and can also implement one or more interfaces.
- An interface cannot contain the definition of a method.
- An interface can inherit from one or more base interfaces.
- An interface cannot contain an event.
- Interface members are by default public.
Which of the following statements is incorrect about delegate?
- Delegates are type-safe.
- Delegates are reference types.
- Delegates serve the same purpose as function pointers in C and pointers to member function operators in C++.
- Only one method can be called using a delegate.
- A delegate does not know about the class of the object that it references.
Which of the following is INCORRECT regarding static constructors?
- There can be only one static constructor in the class.
- The static constructor can be parameterised.
- It can only access the static members of the class.
- There should be no access modifier in static constructor definition.
- The static keyword is used to declare a static constructor.
Which property or method is used to assign a name to a Thread?
- setName()
- isName()
- Name
- Start()
- getName()
Which of the following statements is INCORRECT with reference to StringBuilder class?
- StringBuilder represents a mutable string of characters.
- StringBuilder should be used when we want to make a significant number of changes to a string.
- If characters are added to the StringBuilder object, its length increases at runtime.
- We should always use StringBuilder in place of String.
- We can remove characters from a StringBuilder at runtime.
Which of the following is NOT a benefit of the CLR?
- Garbage collection
- Structured exception handling
- Allows creation of multithreaded, scalable applications
- Use of delegates instead of function pointers for increased type safety and security
- Support for ADO.NET
What does the parameter Initial Catalog denote inside a Connection String?
- Database name
- Username
- Driver Name
- Name of RDBMS Application
- Project Name
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);
- Error
- learn pro
- earn progr
- earn prog
- learn prog
Which of the above collections provide(s) an index based input/output?
1. Stack 2. Queue 3. BitArray 4. ArrayList 5. HashTable
- 1 and 2 only
- 3 and 4 only
- 5 only
- 1, 2 and 5 only
- All of the above
What will be the output of the above code?
for(;;)
Console.Writeline(Hello);
- Compilation Error
- Hello will be printed only once.
- Hello will not be printed even once.
- Hello will be printed infinite number of times.
- Runtime error
What can be defined as 'emphasis on the idea, qualities and properties rather than the particulars'?
- Generalisation
- Abstraction
- Encapsulation
- Object
- Class
Which of the following should be used to implement a 'Like a' or a 'Kind of' relationship between two entities?
- Polymorphism
- Templates
- Inheritance
- Containership
- Encapsulation
Which of the following is a 64-bit Integer?
- char
- long
- short
- int
- byte
Which of the following statements is INCORRECT with reference to functions?
- Function definitions can be nested.
- A function can only return one value at a time.
- To return the control from middle of a function, the return clause should be used.
- Function calls can be nested.
- Functions can be called recursively.
Which of the following can be described as a collection of data retrieved from a data source?
- Dataset
- SQLDataReader
- SQLDataAdapter
- SQLCommand
- SQLTransaction
What is the default value of a 'boolean' variable?
- 0
- 1
- True
- -1
- False