C. where - ntquang

advertisement

PCS THEORY

1. Variables of this data types store actual values. This value stored in a stack. a .

Value Type b .

Reference Type .

2.Variable of reference type store the memory address of other variables in a Stack. a .

True b .

False

3. The Reference Data Types are: 3 choices a .

int , float b .

String , Object c .

Class , interface d .

byte , bit e .

Array , Delegate

4. The built-in reference data types are : 2 choices a .

Class b .

Object c .

Delegate d .

Array , Interface e .

String

5. XML Comments begin with : a .

Three forward slashes b .

Three asterisks c .

double slashes

6. Constants are declared for value types rather than for reference types. a .

True b .

False

7. This statement ensure that no other process or threads running in the computer memory can interfere with the code. ensure security and only work with reference type. a .

Selection statement b .

Iteration statement c .

Jump Statement d .

Fixed Statement e .

Lock Statement

8. This statement is required to tell the garbage collector not to move that object during execution. a .

Jump Statement b .

lock statement

c .

Fixed Statement d .

Check ed and Unchecked Statement

9. Which statements are true? a .

The conditional operator works with two operands b .

The increment operator works with a single operand c .

The bitwise exclusive OR operator compares bits and return 1 if only one of the bits is 1.

d .

the conditional && operator does not check the seconds expression if the first expression is false e .

The compound assignment operators execute from right to left .

10. This typeCasting is carried out automatically by the compiler.

Explicit

Implicit

11. the class which provides useful methods to convert any built-in data type to another built-in data type.

System .

Console .

Convert

System .

Convert

12. This refers to converting a reference type to a value type.

Boxing

UnBoxing

13. This is a process for converting a value type to its reference type. this useful to reduce the overhead on the system during execution.

UnBoxing

Boxing

14. This array is a multi-dimensional array and is reference to as an array of arrays. It considers of multiple arrays where the number of elements within each array can be different.

Rectangular Array .

Jagged Array .

15. This has improved performance and unequal number of columns. a .

Rectangular Array b .

Single dimensional Array c .

Jagged Array d .

Multi dimensional Array

16. This has many rows and columns. a .

Multi dimensional Array b .

Single dimensional Array c .

Rectangular Array d .

Jagged Array

17. This allows you to create arrays using the CreateInstance() method. a .

Array b .

New c .

Array class

18. Method which is used to create Multi- Dimension Array a .

public static Array CreateInstance ( type elementType , int length ); b .

public static Array CreateArray ( type elementType , int length ); c .

public static Array CreateInstance ( type elementType , int rows , int columns );

19. This is the feature of extracting only the required information from object. It’s not show all technical details of object. a .

Encapsulation b .

Inheritance c .

Abstraction d .

Polymorphism

20. Details of what a class contains need not be visible to other classes and objects that use it. a .

Encapsulation b .

Inheritance c .

Polymorphism d .

Abstraction

21. A method name can be an underscore or the "@" character. a .

True b .

Fasle

22. This variable is a special type that is accessed without using an Object of a class. public variable protect variable static variable final

23. This access modifier allows the class members to be accessible within the class as well as within the derived class. internal protected private

24. This access modifier allows the class members to be accessible only within the classes of the same assembly. a .

protected b .

public c .

internal

25. This keyword causes arguments to passed in a method by reference.- 2 choices a .

args b .

ref c .

reg d .

this e .

out

26.The keyword is used to resolve conflicts between variables having same names and to pass the current object as a parameter. out this ref

27. You cannot use the 'this' keyword with static variables and method.

True

False

28. A destructor starts with the character '@' before the class name.

True

False

29. which statements are true?- 3 choices a .

Destructors cannot be overloaded or inherited b .

Destructors can be overloaded but not be inherited c .

Destructors cannot be explicitly invoked d .

Destructors cannot specify access modifiers and take parameters e .

May be more than two Destructor in a class

30. You can use the 'base' keyword for invoking the static methods of the base class.

True

False

31. So as to override a particular method of base class in the derived class, we need to declare the method of base class using the keyword. a .

override b .

virtual

32. This keyword prevents a class from being inherited by any other class. a .

Seales b .

Sealed c .

prevents d .

out e .

virtual

33. When implementing an interface in a class, you need to implement all the abstract methods declared in the interface.

True

False

34. Properties cannot be classified as variables but, They can use the ref and out keywords. a .

True b .

False

35. These are defined with two accessors or methods, the get and set accessors. a .

Properties b .

Fields

36. These represent the behavior of an Object. a .

Fields b .

Properties c .

Methods

37. These represent characteristic of an Object. Can not have any parameters. and can be overidden but cannot be Overload. a .

Properties b .

Methods .

c .

Fields

38. Some of most Namespaces of System are:- 4 choices a .

System .

Collections .

b .

System .

Data c .

System .

namespaces d .

System .

Io / System .

Net e .

System .

Diagnostics

39. This namespace contains classes and interfaces that define conplex data structure as lists,queues ...and dictionaries. a .

System .

Diagnostics b .

System .

IO / System .

Net c .

System .

Data d .

System .

Collections .

e .

System .

Web

40.

This namespace contains classes that make up ADO.NET architecture.

A.

System.Web

B.

System.Collections.

C.

System.Diagnostics

D.

System.Io / System.Net

E.

System.Data

41.

This namespace contains classes that are used to interact with the system processes.

A.

System.Data

B.

System.Diagnostics

C.

System.Io / System.Net

D.

System.Web

42.

This namespace contains classes that enable you to read from and write to data stream and file.

A.

System.Diagnostics

B.

System.Web

C.

System.IO

D.

System.Net

43.

This namespace contains classes that you yo create Web-base applications.

A.

System.Net

B.

System.Web

C.

System.Diagnostics

44.

This namespace provides classes and interfaces that allow communication between the browser and the serevr.

A.

System.Net

B.

System.Web

C.

System.Data

45.

You can apply access modifier such as public, protected, private .. to namspaces

A.

True

B.

False (your answer)

41. Which declaration is used to declare a property. a .

public string property_Name ( int parameter )

{

// body

} b .

public string Property_Name

{

//body.

} c .

public string this [ int Property_name ]

{

// body

} d .

public delegate Property_Name ( typeData parameter1 , typeData parameter2 ); public string property_Name ()

}

{

//body

42. Which declaration is used to declare a indexer. a .

public string [ int index ]()

{

//body

} b .

public string int [ int index ]

{

//body

} c .

public string this [ int index ]()

{

//body

} d .

public string this [ int index ]

}

{

//body

43. Which declaration is used to declare a delegate. a .

public delegates Delagate_Name ( int parameter1 , int parameter2 ){} b .

public delegates Delagates_Name ( int parameter1 , int parameter2 ); c .

public delegate int Delagates_Name ( int parameter1 , int parameter2 ); d .

public delegate float Delagate_Name ( int parameter1 , int parameter2 ){}

44. Which data structure can not be declared in a namespace ? a .

Abstract b .

Interface c .

Structure d .

Enumeration e .

Delegate

45. Namespaces control scopes of a class.

True

False

46. These Exception are thrown by the CLR.

a .

System level Exceptions b .

Application level Exceptions .

47. Returns the exception instance that caused the current Exception. a .

Message b .

StrackTrace c .

InnerException

48. This exception is thrown when the result of an arithmetic, casting or conversion operation is to large to be stored in the destination object or variable. a .

System .

ArithmaticException b .

System .

InvalidCastException c .

System .

OverflowException d .

System .

FormatException

49. Customer exceptions can be used to changed the built-in exceptions with modified message.

True

False

50. Can is Delegate declared within class?

True

False

51. Which statements are true? a .

Delegates are used ti hide static methods .

b .

Delegates are declared with a return type that may or may not be the same as the return type of the referenced method .

c .

Delegates are used to invoke overridden methods .

52. Events can be declared in :- 2 choices

Classes

Methods

Interfaces

Absract / Sealed

Delegates

58.

Events can be declared as :

- 2 choices.

A.

Classes

B.

Abstract / Sealed

C.

interfaces

D.

Methods

E.

Virtual

53. Events are implemented using delegates.

True

False

54. Steps for implementing events in C# are:

1.

Create the event using the delegate .

2.

Subscribe to listen and handle the event .

3.

Define a public delegate for the event

4.

Raise the event . a .

1 2 3 4 b .

1 3 4 2 c .

3 1 2 4 d .

3 1 4 2

55. How to declare Event? a .

delegate delegate_name ( parameters ); event ; b .

delegate delegate_name ( parameters ); event ; c .

event ;

56. which statement are true for Delegate? a. public delegate int Add_Dele ( int t1 , int t2 ); class Delegate_Event

{

//public Add_Dele event dele_Event; public int add ( int a , int b )

{ return ( a + b );

} public void Main ( string [] args )

{ int v1 = 5 ; int v2 = 10 ;

Add_Dele objDel = new Add_Dele ( add ); objDel ( v1 , v2 );

Console .

WriteLine ( "Value1 + Value2 = " + objDel ( v1 , v2 ));

}

} b. public delegate int Add_Dele ( int t1 , int t2 ); class Delegate_Event

{

//public Add_Dele event dele_Event; static int add ( int a , int b )

{ return ( a + b );

} static void Main ( string [] args )

{ int v1 = 5 ; int v2 = 10 ;

Add_Dele objDel = new Add_Dele ( add ); objDel ( v1 , v2 );

Console .

WriteLine ( "Value1 + Value2 = " + objDel ( v1 , v2 ));

}

}

57. Which are true? a .

Event can be declared in an Interface .

b .

Events can are declared as Abstract or Sealed

58. Supports simple iteration over elements of a generic collection. a .

IList b .

IDictionary c .

ICollection d .

IEnumerator

59. Represents a generic collection consisting of the key and value pairs. a .

ICollection b .

IDictionary c .

IEnumerator

60. Which statement are true? a .

Generics are used to work with multiple data type simultaneously .

b .

Generics are verified at run time .

c .

Generics are declared with or without a type parameter d .

Generics can be implemented without a need for explicit or implicit casting .

61. Which statements are true? a .

Iterators use the yield break statement to end th iteration process .

b .

Iterators return a fixed number of values that cannot be changed

62. Which are true? - 2 choices a .

The get accessor can be executed when the property is assigned a new value b .

The get accessor can be declared using a parameter called value .

c .

The get accessor can be executed by referring to the name of the property .

1.Which of the following statement about C# varialble is incorrect ?

A.

A variable is a computer memory location identified by a unique name

B.

A variable's name is used to access and read the value stored in it

C.

A variable is allocated or deallocated in memory during runtime

D.

A variable can be initialized at the time of its creation or later

2. The.……….types feature facilitates the definition of classes ,structures and interfaces over multiple files .

A.

anonymous

B.

partial

C.

named

D.

unamed

3. The....………....class is a variable-length array that can dynamically increase or decrease in size

A.

ArrayList

B.

Stack

C.

Queue

D.

SortedList

4. The.………………...interface defines methods to control the different generic collections.

A.

ICollection

B.

IDictionary

C.

IEnumerator

D.

Ilist

5. The default capacity of an ArrayList class is.....

A.

08

B.

16

C.

24

D.

32

6. in C# ...…………………….are created using delegates

A.

exceptions

B.

events

C.

synchronization

D.

threads

7. Which of the following code declare the delegate Calculation with the return type and the parameter types as integer ?

A.

public delegate int Calculation(int numOne,int numTwo);

B.

pulic delegate Caculation(int numOne,int numTwo);

C.

delegate int Caculation(int numOne,int numTwo);

D.

delegate Caculation(int numOne,int numTwo);

8. The.......constructor initialises an object of the ArrayList class with the specified initial capacity as the parameter .

A.

ArrayList(String s)

B.

ArrayList(ICollection)

C.

ArrayList()

D.

ArrayList(int)

9. Which of the following statements about the different data types in C# are correct?

A.

Value type variables store actual value and are stored on the heap.

B.

Reference type variables store memory address of other variables in a stack .

C.

Both, value and reference type variables can be built in or user defined data types.

D.

int and class are examples of value and reference type variables respectively.

10. Which piece of code display a float value as string ?

A.

Float flotNum = 500.25F;

string stNum = flotNum.ToString();

Console.WriteLine(stNum);

B.

float flotNum = 500.25F;

string stNum = flotNum.ToString();

Console.WriteLine(stNum);

C. float flotNum = 500.25F;

String stNum = flotNum.ToString();

Console.WriteLine(stNum);

D. float flotNum = 500.25F;

string stNum = flotNum.tostring();

Console.WriteLine(stNum);

11

. An ...…….method is created when you instantiate or reference a delegate with a block of ... code.

A.

anonymous,named

B.

named,anonymous

C.

anonymous,unnamed

D.

unnamed,anonymous

12. The........…...exception is thrown when the stack runs out of space while the.….......exception is thrown when the result of an arithmetic,casting or conversion operation is larger in size than the destination object or variable.

A.

OverFlowException, OutOfMemoryException

B.

OutOfMemoryException, NullReferenceException

C.

NullReferenceException, StackOverFlowException

D.

StackOverflowException, OverflowException

13. What is the output of the following code ?

int num =5;

while(num>0)

{

if(num>4)

{

Console.WriteLine(num+"");

}

--num

if(num--= =4)

{

Console.WriteLine("(0)",num);

}

if(num==3)

{

Console.WriteLine("{0}",num);

}

num--;

}

A.

532

B.

533

C.

542

D.

544

14. Which of the following statements about delegates are correct ?

A.

Delegates are objects that contains references to methods that need to be invoked .

B.

Delegates can be used to call any method identified during complication or runtime.

C.

Delegates ,when invoked at runtime,execute the method identified at compile time.

D.

Delegates can be associated with methods provided they have the same return type and parameter type.

15. Managing memory and verifying code safety are functionalities of..……………......

A.

Common Language Runtime

B.

.Net Framework Class Library

C.

Common Language Specification

D.

Common Type System

16. Restriction or constraints can be applied to type parameters by using the......keyword .

A.

select

B.

from

C.

where

D.

return

17. Which of the following statements about the different operator are correct ?

A.

The Addition operator performs concatenation of strings if the operands are strings

B.

The Boolean inclusive OR operator returns true if at least one the expression is true

C.

The Conditional OR operator evaluates the second expression only if the first is true

D.

The Relational operators return a boolean value depending on the comparison being made

18. Which of the following statements about the partial class are correct ?

A.

Partial classes are the only types in C# that support partial definitions

B.

Partial classes can be defined over multiple locations to store different members

C.

Partial classes allow storage of private members in one file and public in another

D.

Partial classes allow multiple developers to work on separate sections simultaneously

19. Which of the following statements about System.Collections.Generic namespace classes are correct ?

A.

The List<T> class provides a generic collection of items that can be dynamically resized

B.

The LinkedList<T> implements the doubly linked list by storing elements in it

C.

The Queue<T> provides a generic collection that follows the First-In-First-Out principle

D.

The Dictionary<K,V> provide a generic collection of sorted key and value pairs

20. The ......………...class is a combination of the.………......and...…………….....classes.

A.

Hashtable,ArrayList,SortedList

B.

Hashtable,SortedList,Dictionary

C.

SortedList,ArrayList,Dictionary

D.

SortedList,Hashtable,ArrayList

21. Which of the following statements about the defferent types of C# statements are correct ?

A.

Selection statements help transfer the flew from one block to another in the program.

B.

Iteration statements help you to repeatedly execute a block of code within program .

C.

Jump statements transfer control after they check whether a paricular condition is true or false

D.

Exception handling statements manage situation that hinder the normal execution of the program.

22. The........method of the ArrayList class copies the elements of a list to an array while the........method also copies elements of a list to an array of type Object.

A.

Contains,TrimToSize

B.

CopyTo,ToArray

C.

TrimToSize,Contains

D.

ToArray,TrimToSize

23. Which of the following statements about constraints on type parameters are correct ?

A.

The T:struct specifies that the type parameter must be of a value type only.

B.

The T:new() specifies that the type parameter must be of a reference type such as a class,interface or a delegate

C.

The T:<base class name> specifies that the type parameter must be a parent class or its successor.

D.

The T:<interface name> specifies that the type parameter must be an interface or should inherit an interface.

24. Which of the following statements about generic methods are correct ?

A.

Generic methods process values whose data types are known only when they are accessed

B.

Generic methods are declared with the generic type parameter list enclosed within angular.

C.

Generic methods can be declared within generic or non generic class declaration.

D.

Generic method bodies ,when declared within a non-generic class ,refer to the type parameters of the method and class.

25. Can you re-arrange the steps given below to implement delegates in C# ?

A.

Declare a delegate

B.

Call method using the delegate object

C.

Create method to be referenced by delegate

D.

Instantiate the delegate

A. A B C D

B. A C D B

C. A D C B

D. A B D C

26. The SortedList class behaves like an ......if you access its elements based on their index number otherwise it behaves like a..........

A.

array,hash table

B.

hash table,heap

C.

heap,queue

D.

queue,array

27. Which of the following statements about generics are correct ?

A.

Generic are data structures that guard against reuse of defined C# data type functionalities.

B.

Generic allow you to reuse the code in a safe manner without casting or boxing.

C.

Generics are parameterized data structures that can work with reference types only.

D.

Generics always accept a type parameter,which is a placeholder for the required date type.

28. Which of the following keywords are associated with iteration statements?

A.

case

B.

foreach

C.

switch

D.

while

29. Which of the following statements about C# are correct ?

A.

C# applications can easily use or integrate code written in other .NET languages.

B.

C# allows use of uninitialized variables as well as checks the overflow of types.

C.

C# can be used to develop both,simple standalone and distributed application.

D.

C# applications are easy to deploy because of its support for XML and SOAP.

31. A....………...is a set of items of same or different data types.

A.

array

B.

event

C.

collection

D.

list

32. The.........property of the System.Exception class returns the Exception instance that caused the current exception.

A.

Message

B.

Source

C.

StackTrace

D.

InnerException

33. Exception thrown due to arithmetic operations or null object reference are...........exceptions.

A.

application-level

B.

system-defined

C.

system-level

D.

user-defined

35. Exceptions thrown due to failure in database connection or network connection are examples of.........exceptions

A. application-level

C.

system-defined

D.

system-level

C.

user-defined

36. The...….....fields are accessible by other classes but.…….....fields are accessible only by the class in which they are declared.

A.

public,private

B.

private,protected

C.

protected,internal

D.

internal,public

37. The....……...interface supports simple iteration over elements a generics ?

A.

ICollection

B.

IDictionary

C.

IEnumerator

D.

Ilist

38. The.........exception is thrown when a value is assigned null object .

A.

OverflowException

B.

OutOfMemoryException

C.

NullReferenceException

D.

StackOverFlowException

39. Which of the following statements about delegates in C# are correct?

A.

A delegate can accept a block code as a parameter.

B.

A delegate can invoke one method at a time.

C.

A delegate can encapsulate static methods.

D.

A delegate is declared using the delegate keyword

40. ........allow you to reuse a code for different data types.

A.

IDictionary

B.

LinkedList

C.

Inheritance

D.

Generics

41. Which of the following statements about exceptions are correct ?

A.

The System.Exception class is the base class that allows you to handle all exception.

B.

The System.Exception class contains methods that cannot be inherited by other exception classes.

C.

The System.Exception class can be inherited directly or indirectly by all other exception.

D.

The System.Exception class contains properties that are common to all exceptions.

42. An....…………..method is an inline nameless block of code that can be passed as a delegate parameter ?

A.

anonymous

B.

named

C.

partial

D.

unnamed

1. The .NET framework enables the use of C and C++ programming languages

False

2. C# provides a complete object-oriented architecture

True

3. C# allows you to write applications that target mobile devices

True

4. Microsoft .NET provides a platform for developing the next generation of windows/web applications

True

5. C# provides a very simple and yet powerful tool for building interoperable, scalable and robust applications

True

6. Windows Forms = Provides a set of classes to design forms for windows-bbased applications

7. ASP.NET = Provides a set of classes to build Web applications

8. Common Language Runtime (CLR) = Performs functions such as memory management, error handling and garbage collection

9. Web Forms = Provides a set of classes to design forms for the web pages similar to the

HTML forms

10. ADO.NET = Provides classes to interact with database

11. The .NET Framework minimizes sofware deployment and versioning conflicts by proviing a code-execution environment

True

12. The .NET Framework supports only VB and C# languages

False

13. The Just-In-Time (JIT) complier converts the operating system code to the MSIL code when the code is executed for the first time

False

14. The .NET Framework provides consistent object-oriented programming environment

True

15. The .NET Framework builds, deploys and runs applications

True

16. The garbage collector allocates and de-allocates memory using automatic memory management

True

17. C# applications integrate and use the code written in any other .NET language

True

18. Automatic memory management decreases the quality of the code and reduces the performance and the productivity

False

19. Developers create mobile applications for pocket PCs, PDAs and cell phones using the

C# language

True

20. C# application programming uses objects so that code written once can be reused

True

21. VS 2005 is used for building high-performance desktop applications, XML Web Services mobile applications and ASP Web applications

True

22. The Team system edition of VS 2005 is used for building applications for personal anjoyment and use

False

23. VS 2005 is used to carry out programming in languages like Visual C++ 2005 and Visual

C#

True

24. VS 2005 is used to simplify team-based design, development and deployment of enterprise solutions

True

25. The Standard edition of VS 2005 is designed for professional developers

False

26. Code Snippets = Allows the developer to enter the source code quickly with the help of certain keystrokes

27. Edit Marks = Provides a visual indication of what has changed during the editing session

28. AutoRecover = Saves the work on a regular basic and thus minimizes accidental loss of information

29. Refactoring = Changes the structure and content of the code in many ways

30. Comprehensive Tools Platform = Offers productive developer tools for novice as well as experienced programmers

31. The Solution Explorer provides a list of topics specific to the area of the IDE you are working in or the task you are trying to finish

False

32. A console window in C# allows console applications to run

True

33. The Code window enables you to view and change the design-time properties and events of selected objects that are located in editors and designer

False

34. The Dynamic Help window provides a list of topics specific to the area of the IDE you are working in or the task you are working on

True

35. VS 2005 Integrated Development Environment provides the necessary support to compile and execute C# programs

True

36. The name of the variable can contain letters and digits

True

37. The first chracter in the variable name can be a digit

False

38. The name of the variable can contain an underscore

True

39. The name of the variable can contain keywords

False

40. The variable names RectLeng and rectleng are the same

False

41. You can insert multi-line comments by starting the comment with double slash (//)

False

42. You cannot insert infinite number of comments

False

43. You can insert XML comments by starting the comment with a double slash (//)

True

44. You can specify the parameters of a method using the <param> tag

True

45. You can extract XML comments to an XML file

True

46. Constants can be initialized after you declare indentifiers

False

47. Constants cannot be identified by the complier at the time of compilation

False

48. Literals can be of any data type

True

49. Interger literals can be of float type

False

50. Verbatim string literals can be prefixed by the @ character

True

51. Keywords are used to avoid any conflicts during complie time

True

52. Keywords cannot be modified in C#

True

53. Escape sequence characters are prefixed with the ‘/’ character

False

54. Escape sequence characters are enclosed in single quotes

False

55. The backslash character can be displayed using the respective escape sequence character

True

56. \ uhhhh = Unicode characters for haxadecimal values

57. \t = Horizontal tab

58. \xhh = hexadecimal notation

59. \0 = Unicode character

60. \r = Carriage return

61. The Read() method always inserts the new line character at the end of the read character

True

62. The data type conversion methods exist in the System class

False

63. Format specifiers in C# enable you to display customized output

True

64. Format specifiers require input methods of C#

False

65. Forat specifiers allow you to change a numberic value to a date-time value

False

66. C = Currency

67. D = Decimal

68. X = Hexadecimal

69. E = Exponent

70. F = Fixed point

71. F = dddd, MMMM dd, yyyy HH:mm

72. M = MMMM dd

73. Y = MMMM, yyyy

74. G = MM/dd/yyyy HH:mm:ss

75. D = MM/dd/yyyy

76. Statements end with a comma

False

77. Functions refer to related statements in a program

False

Download