C Sample Test,Sample questions

Question:
 Button class derives from

1.Checkbox

2.RadioButton

3.ButtonBase

4.None of the above


Question:
 C# supports a technique known as________, which allows a method to specify explicitlythe name of the interface it is implementing.

1.Method Implementation

2.Implicit Interface Implementation

3.Explicit Interface Implementation

4.Iterative Interface Implementation


Question:
 Exponential formatting character (‘E’ or ‘e’) converts a given value to string in the form of _______.

1.m.dddd

2.E+xxx

3. m.dddd

4.E+xxx


Question:
 How many enumerators will exist if four threads are simultaneously working on an ArrayList object?

1.1

2.3

3.2

4.4


Question:
 LINQ to SQL works with

1. SQL Server

2.SQL Server Compact 3.5

3.both (a) and (b)

4.None of the above


Question:
 Suppose a Generic class called SortObjects is to be made capable of sorting objects of any type (Integer, Single, Byte etc.). Which of the following programming constructs should be used to implement the comparison function?

1.Namespace

2.Interface

3.Encapsulation

4.Delegate


Question:
 When an instance method declaration includes the abstract modifier, the method is said tobe an ______.

1.Abstract method

2.Instance method

3.Sealed method

4. Expression method


Question:
 Which namespace includes most of the Control classes for developing Windows applications?

1.System;

2.System.Windows.Controls

3.System.Windows.Components.Forms

4. System.Windows.Forms


Question:
 Which of the following is a definition of a database?

1.It is a collection of related information organized on a computer.

2. It is single flat file.

3.It is a file that can only be set up on a single PC.

4.It is a group of files that can be set up only on a network.


Question:
 Which of the following is included in Visual Studio IDE?

1.Form Designer

2. Code Editor

3.Solution Explorer

4.All of the above


Question:
 Which of the following is the correct way to access all elements of the Queue collection created using the C#.NET code snippet given below? Queue q = new Queue(); q.Enqueue("Sachin"); q.Enqueue('A'); q.Enqueue(false); q.Enqueue(38); q.Enqueue(5.4)

1.IEnumerator e; e = q.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current);

2. IEnumerable e; e = q.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current);

3. IEnumerator e; e = q.GetEnumerable(); while (e.MoveNext()) Console.WriteLine(e.Current);

4.IEnumerator e; e = Queue.GetEnumerator(); while (e.MoveNext()) Console.WriteLine(e.Current);


Question:
 Which of the following namespace contains the LINQ to XML?

1.System.Xml;

2.System.Data;

3.System.Xml.Linq;

4.System.Linq;


Question:
 Which of the following should be used to implement a 'Has a' relationship between twoentities?

1.Polymorphism

2.Templates

3.Containership

4.Encapsulation


Question:
 Which of the following statements are correct about the delegate declaration given below? delegate void del(int i); 1. On declaring the delegate a class called del will get created. 2. The signature of del need not be same as the signature of the method that we intend to call using it. 3. The del class will be derived from the MulticastDelegate class. 4. The method that can be called using del should not be a static method. 5. The del class will contain a one-argument constructor and an lnvoke() method

1. 1, 2 and 3 only

2.1, 3 and 5 only

3.2 and 4 only

4.4 only


Question:
 Which of the following statements is correct about an interface used in C#.NET?

1. If a class implements an interface partially, then it should be an abstract class.

2.Class cannot implement an interface partially.

3.An interface can contain static methods.

4.An interface can contain static data.


Question:
 Which of these can be overloaded?

1.Constructors

2.Methods

3. Both a & b

4.None of the mentioned


Question:
A class implements two interfaces each containing three methods. The class contains no instance data. Which of the following correctly indicate the size of the object created from this class?

1.12 bytes

2.24 bytes

3.0 bytes

4. 8 bytes


Question:
A computer application for managing databases and pulling together data to generate reports and make decisions is known as a(n)

1.. Database System (DS).

2.File Manager (FM).

3.Management System (MS)

4.Database Management System (DBMS).


Question:
A connection string contains

1. A. a using directive

2. the name of the data source

3.the version number of database management system

4.the list of fields in the database


Question:
A field is a

1. group of records.

2.index that locates information in a table.

3. common characteristic in a table of information.

4.code that represents a record.


Question:
C# treats the multiple catch statements like cases in a _____________ statement.

1. If

2.Switch

3.For

4.While


Question:
Constructors are used to

1.initialize the objects

2.construct the data members

3.both a & b

4.None of the mentioned


Question:
Correct statement about constructors in C#.NET is ?

1.Constructor cannot be overloaded

2. Constructor allocate space for object in memory

3.Constructor are never called explicitly

4. Constructor have same name as name of the class


Question:
Databases store information in records, fields and:

1. data providers

2.grids

3.columns

4.tables


Question:
Each data provider class is grouped and accessible through its:

1.namespace

2.database

3.datagrid

4.provider


Question:
Forms and reports, used for entering and editing records, and for generating useful information in reports are

1.additional database objects.

2.only useful for complex databases.

3.difficult to generate.

4.stored separately from databases.


Question:
How can you prevent inheritance from a class in C#.NET ?

1.Declare the class as shadows. B. C.

2.Declare the class as overloads.

3.Declare the class as seal

4.None of the above


Question:
In C#, having unreachable code is always an _____.

1.Method

2.Function

3.Error

4.Iterative


Question:
In Microsoft Visual Studio, ______ technology and a programming language such as C#is used to create a Web based application.

1. JAVA

2.J#

3.VB.NET

4.ASP.NET


Question:
In Visual Studio, the tool that enables you to connect to a database and automatically populate a dataset object using a TableAdapter object is the ___________wizard:

1.Data Source Configuration

2.Data Source

3.Query Builder

4. DataSet Designer


Question:
In which of the following collections is the Input/Output index-based? 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


Question:
In XML, a document is a hierarchy of

1.attributes

2.elements

3.tags

4.All of the above


Question:
Inheritance is ______ in nature.

1.Commutative

2.Associative

3.Transitive

4.Iterative


Question:
Number of constructors a class can define of ?

1.1

2.2

3.Any number

4.None of the mentioned discuss


Question:
The controls available in the tool box of the ______ are used to create the user interface of a web based application.

1.Microsoft visual studio IDE

2.Application window

3.Web forms

4.None of the above


Question:
The following namespaces (System.Data.OleDB, System.Data.SqlClient, System.Data.Odbc, System.Data.OracleClient) include classes for different:

1.Data providers

2.File streams

3.ADO.NET applications

4.Databases


Question:
The point at which an exception is thrown is called the _______

1.Default point

2.Invoking point

3.Calling point

4.Throw point


Question:
The reason that C# does not support multiple inheritances is because of ______.

1.Method collision

2.Name collision

3.Function collision

4.Interface collision


Question:
The scope of a variable depends on the ____________ and _________.

1. Main method, place of its declaration

2.Type of the variable, console

3.compiler, main

4.Type of the variable, place of its declaration


Question:
The theory of _____ implies that user can control the access to a class, method, orvariable.

1.Data hiding

2.Encapsulation

3.Information Hiding

4.Polymorphism


Question:
The ______ are the Graphical User Interface (GUI) components created for web basedinteractions..

1.Web forms

2.Window Forms

3.Application Forms

4.None of the above


Question:
The ______ parentheses that follow _____ indicate that no information is passed to Main().

1. Empty, class

2.Empty, submain

3.Empty, Main

4.Empty, Namespace


Question:
To avoid writing additional SQL statements to update a live database, you instantiate an object of which class?

1. DataAdapter

2.DataReader

3.DataSet

4.CommandBuilder


Question:
To overload a method which of the following statement is false?

1.If the return type is different methods are overloaded

2.Name of the overloaded method should be same

3.Type of the parameter should be different

4.Order of the parameter should be different if types are same


Question:
Web Forms consists of a _______ and a _________ .

1.Template, Component

2.CLR, CTS

3.HTML Forms, Web services

4.Windows, desktop


Question:
What is a delegate?

1.A strongly typed function pointer.

2.A light weight thread or process that can call a single method.

3.A reference to an object in a different process.

4.An inter-process message channel.


Question:
What is return type of constructors?

1.int

2.float

3.void

4.None of the mentioned


Question:
Which method have same name as that of its class?

1. A. delete

2.class

3.constructor

4.None of the mentioned


Question:
Which of following statement are correct about functions?

1. C# allows a function to have arguments with default values

2.Redefining a method parameter in the method’s body causes an exception

3.C# allows function to have arguments of private type

4.Omitting the return type in method definition results into exception


Question:
Which of the Control objects is viewed as a container that can hold other objects when you design a Windows application?

1.Control

2.Button

3.Window

4.Form


Question:
Which of the following can be facilitated by the Inheritance mechanism? 1 Use the existing functionality of base class. 2 Overrride the existing functionality of base class. 3 Implement new functionality in the derived class. 4 Implement polymorphic behaviour. 5 Implement containership.

1. 1, 2, 3

2. 3, 4

3.2, 4, 5

4.3, 5


Question:
Which of the following characterizes the relational model for databases?

1. It organizes data into a hierarchal format.

2.It splits data into separate row and column areas called tables.

3.It organizes data into one large table.

4.It organizes data into a network format.


Question:
Which of the following is true about dispose() method?

1. A. This method is protected.

2.Its return type is int.

3.It accepts a float parameter.

4.All of the above


Question:
Which of the following should be used to implement a 'Like a' or a 'Kind of' relationshipbetween two entities?

1.Polymorphism

2.Containership

3.Templates

4.Inheritance


Question:
Which of the following statements are correct about an ArrayList collection thatimplements the IEnumerable interface? 1. The ArrayList class contains an inner class that implements the IEnumerator interface. 2. An ArrayList Collection cannot be accessed simultaneously by different threads. 3. The inner class of ArrayList can access ArrayList class's members. 4. To access members of ArrayList from the inner class, it is necessary to pass ArrayList class's reference to it. 5. Enumerator's of ArrayList Collection can manipulate the array.

1.1 and 2 only

2.1,3 and 4 only

3. 2 and 5 only

4.None of the above


Question:
Which of the following statements are correct about the Stack collection? 1. It can be used for evaluation of expressions. 2. All elements in the Stack collection can be accessed using an enumerator. 3. It is used to maintain a FIFO list. 4. All elements stored in a Stack collection must be of similar type. 5. Top-most element of the Stack collection can be accessed using the Peek() method.

1.1 and 2 only

2.3 and 4 only

3.1, 2 and 5 only

4.All of the above


Question:
Which of the following statements is correct about an interface?

1.One interface can be implemented in another interface.

2.An interface can be implemented by multiple classes in the same program.

3. A class that implements an interface can explicitly implement members of that interface.

4.The functions declared in an interface have a body.


Question:
Which of the following statements is correct about Interfaces used in C#.NET?

1.All interfaces are derived from an Object class.

2.Interfaces can be inherited.

3.All interfaces are derived from an Object interface.

4.Interfaces can contain only method declaration


Question:
Which of the following statements is correct about the C#.NET code snippet given below?class Student s1, s2; // Here 'Student' is a user-defined class. s1 = new Student(); s2 = new Student();

1.Contents of s1 and s2 will be exactly same.

2.The two objects will get created on the stack.

3.Contents of the two objects created will be exactly same.

4.The two objects will always be created in adjacent memory locations.


Question:
_______ is a set of devices through which a user communicates with a system using interactive set of commands.

1.Console

2.System

3.Keyboard

4.Monitor


More MCQS

  1. C# MCQS -Programming (.NET Framework)
  2. C# MCQS -Programming(Control Instructions)
  3. C# MCQS - Functions and Subroutines(.NET Framework)
  4. C# Programming-Constructors
  5. C# Programming- Arrays
  6. C# Programming -Structures
  7. C# Programming-Properties
  8. C# Programming -Exception Handling
  9. C# Programming -Interfaces
  10. C# Programming -Delegates
  11. C# Programming -Generics
  12. C# Programming - Datatypes
  13. C# Programming- Operators
  14. C# Programming -Classes and Objects
  15. NET Programming mcqs
  16. Computer Science Engineering (CSE) .NET Programming
  17. C# Programming Mcq Set 1
  18. C# Programming Mcq Set 2
  19. C#.NET Programming Mcq
Learn ,Learn C Objetive choice questions and answers,C Multiple choice questions and answers,C objective, C questions , C answers,C MCQs questions and answer
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!