Thursday, 22 March 2012

.Net Framework and C# Basics - Test No : 01


.Net Framework and C# Basics - Test No : 01



 Test Number:2 Topics :Assembly, Event, Delegates_exceptions

Test 04 - Reflection, Custom Attributes, Threading, Windows Service

Test No : 05 -Remoting ,Webservices



Prefixing a variable with the const keyword when it is declared 
and initialized designates that variable as a ___________________.


a) Read Only

b) constant

c) Write only

d) none of above



C# distinguishes datatypes in two categories ie ______ and ____

a) Selfdescribing types and UserDefine types

b) Interface types and pointer types

c) Value types and refrence types

d) All of the above


_______ and _______ are reference type of datatypes

a) class and strut

b) delegate and event

c) Object and string

d) interface and pointers


_______ and _______ are conditional statements.

a) if and else

b) if and switch

c) goto and continue

d) return and break



________ are loops available with c#.

a) for loop

b) While and do while loop

c) foreach loop

d) All of the above


_________ are jump statements

a) goto

b) break

c) continue and return

d) all of the above

An enumeration is a _______.

a) primitive datatype

b) selfdescribing type

c) user defined integer type

d) None of above


int[] integers is ______dimentional array

a) one

b) two

c) three

d) Can be any one from above


Namespaces provide a way of organizing related ________ and ____.

a) Classes and other types

b) classes and methods only

c) classes and structs only

d) classes and fields only


C# allows you to abbreviate a class's full name with the help of
 listing class's namespace at the top of file by ____________ keyword.

a) alias

b) const

c) using

d) new

using Introduction = Wrox.ProCSharp.Basics; syntax is 
used to create _______ of namespace

a) aliases

b)  instance

c) Object

d) variable


_____________ method makes the class method the entry point for
 the program

a) Main()

b) main()

c) main(string [] args)

d) All of the above


_______ is used to access any option passed through the command
 line when program gets started

a) Main(string[] args)

b)main(string [] args)

c) main(string s1)

d)Main(object obj)


Console.WriteLine() adds a _____ at the end of output

a) newline

b) newline character

c) writeline

d) None of above


For single line and multiline comment, these symbols
 _______ and _______ are used

a) // and **/__/**

b)// and */__ /*

c) // and /*___*/

d)// and "/ _/"


___________ directives inform the compiler whether or not to compile a
 block of code.

a) #if

b) #elif

c)#else and #endif

d)All of the above


_________ directives are used to indicate that a certain block of code 
is to be treated as a single block with a given name.

a) #region and #endregion

b)#pragma

c)#else, and #endif

d)All of the above


___________ directive can either suppress or restore specific compiler warnings

a) #region and #endregion

b)#pragma

c)#else, and #endif

d)All of the above


Identifiers are the names you give to _________

a)objects

b)variables

c) instance

d) All of the above


For class and struct you need to use keyword _____ for creating instance

a) public

b) static

c) new

d) internal


Class is blueprint of ______

a) struts

b) interface

c) static class

d) object


fields, constants, and events are _______ while methods, properties,
 constructors, finalizers, operators, and indexers are __________.

a) data members, function members

b) class members, struct members

c) variables, datatypes

d) Can be anything  from above


Forcing value parameters to be passed by reference, you need to use ____ keyword

a)new

b) out

c) Using

d) ref


Several versions of the method that have different signatures is
 termed as _________.

a) method overriding

b) method overloading

c) siganture overloading

d) operator overloading


During instantiating of an object ________ is called first

a) Destructor

b) parameters

c)first  method

d) constructor


________ are executed only once during the instantiation of objects of
 same class

a) Destructor

b) parameters

c)static constructor

d) constructor

_________ do not support inheritance

a) class

b) interface

c) partial class

d) struct

_______ donot allow to define constructor that takes no parameter

a)class

b)interface

c) statis class

d) struct

classes and structure are ______ and ______ datatypes respectively

a) Selfdescribing types and UserDefine types

b) Interface types and pointer types

c) Refrence types and Value types

d) class type and structure type

If a class contains nothing but static methods and properties, the class itself  is ______.

a) abstract class

b) object class

c) static class

d) sealed class


All .NET classes are ultimately derived from class ____________

a) .net Framework

b) common language runtime

c) System.object

d) All of the above


C# ____________ multiple inheritance classes.

a) support

b) does not support

c) all of above

d) none of above


By declaring a base class function as ________, you allow
 the function to be overridden in any derived classes

a) new

b) sealed

c) public

d) virtual


For hiding method, _______ keyword is used

a) hide

b) sealed

c) new

d) private


_________ cannot be instantiated

a) partial class

b) an abstract class

c) sealed class

d) All of the above


Using protected access modifier, item is visible to __________.

a)class types

b)derived type

c) base types

d) outside assembly


_________ overrides an inherited virtual member, but
 cannot be overridden by any classes that inherit from this class

a) class

b) an abstract class

c) sealed class

d) All of the above


An interface has neither ________  nor ___________.

a) contructor, fields

b) methods, properties

c) delegates,events

d) All of the above


[] operator is used for _______

a) Indexing (for arrays and indexers)

b) or conditions

c) and conditions

d) all of the above


?: (ternary operator) is used for _________.

a) jump

b) return

c) break

d) conditional


+= and *= are _______ operators

a) ternary

b) primary

c) unary

d) assignments


_____ can normally be achieved only if you can guarantee that the value is not changed in any way

a) Explicit conversions

b) implicit conversions

c) casting

d) All of the above


_______ allow you to convert reference types to value types and _______ allow
 to convert value types to reference types

a)  unbox and box

b) cast and uncast

c) unboxing and  boxing

d) Can be any one from above

_________is a static method that tests whether two references refer to the same instance of a class

a) Equals()

b) Refrence Equals()

c) ToString()

d) Compare()


The System.Object implementation of the virtual version of _______ works by comparing references

a) Equals()

b) Refrence Equals()

c) ToString()

d) Compare()

the sequence _____ indicates the beginning or end of a word

a) /b

b) b/

c) /b/

d) b/*

________ represents a set of objects that you can access by stepping through each
 element in turn and to access the set of objects, you need to use _______.

a) Array, foreach loop

b) Collection,forloop

c) collection,foreachloop

d) collection, do while loop

For Compilation of C# code, which language specific compiler is used?

a) gacutil.exe

b) csc

c) both a and b

d) none of above

What are the two types of data types in C#?

a) value, reference

b) int, int32

c) string, object

d) All of the above

int [ , ] integers ; In this declaration what integers represents?

a) simple array

b) multidimentional array

c) jagged dimentional array

d) All of the above


What is CLR ?

a) Conventional Language Runtime

b) Clarified Language Runtime

c) Common Language Runtime

d) Colloquial Language Runtime


The statement that is used to replace multiple if statements is called

a) The switch & case statement

b) ?: (ternary operator)

c) The nestedif statement

d) The #endif statement


Which of the following is not a C# keyword?

a) Implements

b) If

c) Private

d) Delegate


what is the default access specifier for a Top-level Class, which are not nested into other Classes

a) public

b) private

c) protected

d) internal


If a method is marked as protected internal who can access it?

a)  Access is limited to the current assembly

b) Access is limited to the containing class or types derived from the containing class.

c) Access is limited to the containing type

d) Access is limited to the current assembly or types derived from the containing class.

An array is a list of data items that _________________

a) all have the same type

b) all have different names

c) all are integers

d) all are orignally set to ‘null’ (‘\0′)


How do you convert a string into an integer in .NET?

a) Int32.Parse(string)

b) Int64.Parse(string)

c) Int.Parse(string)

d) Int16.Parse(string)


C# does not support?

a) interface

b) abstract

c) multiple inheritance

d) none of above

Which operator is used to allocate memory for an instance

 of a class, as well as to pass arguments to a constructor of that class?

a) new

b) delete

c) alloc

d) malloc

int x = 42; int s = 43; x++; x += –s; Console.WriteLine(x);

a) 2

b) 85

c) 42

d) 42

Which of the following is not the feature of CLR

a) Garbage collection

b) Language integration

c) compilation from source code to MSIL

d) Multiple versioning support

When was the first version of .net Framework released?

a) 2000

b) 2002

c) 2005

d) 2001

What is CIL?

a) Common Intermediale Language

b) Common Interface Language

c) Colloquial Interface Language

d) Colloquial Intermediale Language

Wich of the following is true about the namespace?

a) Namespace logically group objects

b) Namespace logically group types

c) Namespace virtually group classes

d) none of above

Information provided by Assembly Manifest includes

a) Assembly Name

b) Culture

c) Strong name

d) All of the above

What is CLS?

a) Colloquial Language Specification

b) Common Language Specialisation

c) Common Language Specification

d) Colloquial Language Specialisation

Which of the following is not an elements of .net Framework?

a) CLR

b) COM

c) CTS

d) CLS


Which of the following is false about value Types?

a) Stores the data.

b) They are lighter objects

c) several variables can reference the same data

d) One variable can have just one value
.

Which of the following is  true about code security?

a) Role based security is better security for user

b) Code access security is best for system resources

c) both a and b are best measures of security

d) All of  the  above

Which of the following is not a type of JIT compiler?

a) Pre - JIT

b) Dual - JIT

c) Econo - JIT

d) none of the above


Post a Comment