Posted in PCS ( C#)

Đề thi lý thuyết 1 môn PCS (đáp án luôn)

1.Which of the following statement about C# varialble is incorrect ?
A. variable is a computer memory location identified by a unique name
2. The.……types feature facilitates the definition of classes ,structures and interfaces over multiple files?
B. partial
3. The….…class is a variable-length array that can dynamically increase or decrease in size?
A. ArrayList
D. SortedList

4. The.………interface defines methods to control the different generic collections?
A. ICollection
5. The default capacity of an ArrayList class is…..?
6. in C# …………are created using delegates
B. events
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);
8. The…….constructor initialises an object of the ArrayList class with the specified initial capacity as the parameter .
D. ArrayList(int)
9. Which of the following statements about the different data types in C# are correct?
B. Reference type variables store memory address of other variables in a stack .
D. int and class are examples of value and reference type variables respectively.
10. Which piece of code display a float value as string ?
B. float flotNum = 500.25F;
string stNum = flotNum.ToString();
C. float flotNum = 500.25F;
String stNum = flotNum.ToString();
11. An ……….method is created when you instantiate or reference a delegate with a block of … code.
C. anonymous, unnamed
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.
C. NullReferenceException, StackOverFlowException
D. StackOverflowException, OverflowException

13. What is the output of the following code ?
int num =5;
if(num–= =4)
B. 503
14. Which of the following statements about delegates are correct ?
A. Delegates are objects that contains references to methods that need to be invoked .
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
16. Restriction or constraints can be applied to type parameters by using the……keyword .
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
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
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 class provides a generic collection of items that can be dynamically resized
C. The Queue provides a generic collection that follows the First-In-First-Out principle
D. The Dictionary provide a generic collection of sorted key and value pairs

20. The ………………class is a combination of the.……………and…………………..class es.
D. SortedList,Hashtable,ArrayList

21. Which of the following statements about the defferent types of C# statements are correct ?
B. Iteration statements help you to repeatedly execute a block of code within program .
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.
B. CopyTo,ToArray
23. Which of the following statements about constraints on type parameters are correct ?
C. The T: specifies that the type parameter must be a parent class or its successor.
D. The T: 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
C. Generic methods can be declared within generic or non generic class declaration.
25. Can you re-arrange the steps given below to implement delegates in C# ?
Declare a delegate
Call method using the delegate object
Create method to be referenced by delegate
Instantiate the delegate
B. A C D B
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
27. Which of the following statements about generics are correct ?
B. Generic allow you to reuse the code in a safe manner without casting or boxing.
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?
B. foreach
29. Which of the following statements about C# are correct ?
A. C# applications can easily use or integrate code written in other .NET languages.
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.
30. ………….are a kind of parameterized data structure that can work with value types as well as reference types.
D. Enumerator
31. A….…………is a set of items of same or different data types.
C. collection
32. The………property of the System.Exception class returns the Exception instance that caused the current exception.
A. Message
33. Exception thrown due to arithmetic operations or null object reference are………..exceptions.
C. system-level
35. Exceptions thrown due to failure in database connection or network connection are examples of………exceptions
A. application-level
36. The………..fields are accessible by other classes but.………..fields are accessible only by the class in which they are declared.
A. public,private
37. The….………interface supports simple iteration over elements a generics ?
C. IEnumerator
38. The………exception is thrown when a value is assigned null object .
C. NullReferenceException
39. Which of the following statements about delegates in C# are correct?
B. delegate can invoke one method at a time.
C. delegate can encapsulate static methods.
D. delegate is declared using the delegate keyword
40. ……..allow you to reuse a code for different data types.
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.
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
43. Which of the following statements about Visual Studio 2005 IDE key elements are correct? (chon 1 dap an!)
A. The code Editor facilitates writing, display and aditing of form, event, and method code.
B. The Dynamic help window provides a list of topics depending on the active IDE area or task.
D. The Solution Explorer provides an organized view of projects and access to their commands.
44: Which of the following statements about expressions and statements are correct?
A. Statements may or may not return values, but expressions always return values.
D. Compilers execute statements and since expressions are part of statements, they are executed with them.
45: The Visual Studio 2005 … edition is a proper choice for students enthusiasts and hobbyists? (chon 1 dap an!)
C. Standard
46: The … class is a combination of the Hashtable class and the ArrayList class?
A. SortedList


Tác giả:

Thích thì chiều sao phải xoắn :))

Trả lời

Mời bạn điền thông tin vào ô dưới đây hoặc kích vào một biểu tượng để đăng nhập: Logo

Bạn đang bình luận bằng tài khoản Đăng xuất / Thay đổi )

Twitter picture

Bạn đang bình luận bằng tài khoản Twitter Đăng xuất / Thay đổi )

Facebook photo

Bạn đang bình luận bằng tài khoản Facebook Đăng xuất / Thay đổi )

Google+ photo

Bạn đang bình luận bằng tài khoản Google+ Đăng xuất / Thay đổi )

Connecting to %s