Professional Documents
Culture Documents
63 ______ is the main class for creating threads and controlling them
A Thread -
B ThreadPool
C ThreadStart
D Monitor ---------------Cau nay dung
E WaitHandle
64 ______ contains operationg system-specific objects that wait for access to shared
resources
A Thread
B ThreadPool
C ThreadStart
D Monitor
E WaitHandle ----------------Cau nay dung
65 ______ comprises a set of threads that can be used for posting work items,
processing asynchronous I/O, waiting on
A WaitHandle
B ThreadPool ----------------Cau nay dung
C Timer
D Monitor
A TRUE
B FALSE ----------------Cau nay dung
67 The methods represented by ThreadStart can have zero, one or more parameters
A TRUE
B FALSE ----------------Cau nay dung
68 An instance of a class which defines the method containing task action needs to be
created before starting a thread object
69 The start method in the Thread class starts immediately the thread execution
A TRUE
B FALSE ----------------Cau nay dung
71 _______ method blocks the calling thread till the current thread ends
A Sleep()
B Join() ----------------Cau nay dung
C IsAlive()
D Block()
72 Which property returns a value that contains the state of the current thread.
74 A portion of code which is accessed by multiple threads at the same time is called
______
A Reentrant
B Critical section ----------------Cau nay dung
C Immutable object
A Critical section
B Locking
C Immutable object
D Thread pooling ----------------Cau nay dung
76 ______ is a concept which allows only one thread to excusively access particular
sections of code at a time
A Locking
B Thread pooling ----------------Cau nay dung
C Reentrant
77 Reentrant is __________
78 Which 3 of the following statement with reference to .NET and COM are TRUE?
79 The __________ utility can be used to convert a COM Type Library into a .NET
assembly.
A TlBExp
B TlbImp
C TlBLib ----------------Cau nay dung
D TlBDet
80 The TlbExp Utility creates the proxy for the COM Dlls.
A TRUE
B FALSE ----------------Cau nay dung
81 If the .NET component needs to be accessed from more than one application, the
.NET component then needs to be a shared assembly and has to be installed on the
GAC.
83 When a .NET component is called from COM, the runtime generates a wrapper
object known as the __________________.
84 Regardless of how many COM clients try to access the component, the runtime
creates only one CCW for a managed .NET component.
85 .NET client and COM clients can simultaneously make calls to the same .NET
component.
86 In order to call a .NET component from a COM client, you need to first register the
assembly using the _________ utility.
87 The Runtime Callable Wrapper does not contain any form of business logic.
89 Which 2 of the following statements with reference to .Net components are TRUE ?
A The CLR manages the lifetime of the objects in .Net. ----------------Cau nay dung
B .NET clients use interfaces to learn about the functionality of the object.
C .Net files can be either .dll or .pe files ----------------Cau nay dung
D .Net objects must reside in the same memory location throughout the lifetime of the
object
92 Which term is used for the data conversion from Com to .Net ?
A Marshalling
B Type-casting
C Data-conversion
D Marshaled ----------------Cau nay dung
93 What must one do to register or unregister the .Net components in the Windows
registry ?
95 The ___________ command gives you the output of COM type library.
A EnvironmentPermission
B Encoding style ----------------Cau nay dung
C Version No.
D File path
99 We write the contents of the dataset to an XML file using the ___________ method
of the dataset object.
A WriteStartDocument()
B Write()
C WriteXml() ----------------Cau nay dung
D WriteStartElement()
A Statement 1 is true
B Statement 2 is true
C Both the Statements are true
D Both the Statements are false ----------------Cau nay dung
101 When there are no more nodes to be read in the file, the XMLReader class returns
________.
A0
B 1 ----------------Cau nay dung
C FALSE
D EOF
Statement A: The XMLNodeList is an ordered list of nodes but the data represented by
them is not live.
Statement B: The XMLNode and the XMLNodeList class collectively make up the core
of the DOM implementation in .NET.
A Statement 1 is true
B Statement 2 is true ----------------Cau nay dung
C Both the Statements are true
D Both the Statements are false
104 The Document Object Model is implemented in .NET using the _________ class.
105 Which 2 of the following statements with reference to XSLT are TRUE?
A XSLT is used to provide the graphics utility to the XML document
B XSLT is used to map more then one XML document ----------------Cau nay dung
C XSLT can be used with various languages ----------------Cau nay dung
106 The __________ method of the XMLTextWriter class writes the specified start tag.
A XDR schemas
B XML schemas
C DTDs schemas
D All of the above ----------------Cau nay dung
E None of the above
108 Which one of the following classes allows you to transform documents using
stylesheets in XML?
A System.XML.Style
B System.XML.Xsl ----------------Cau nay dung
C System.XML.Schema
D System.XML.Xpath
A SqlConnection
B SqlDataAdapter
C Dataset ----------------Cau nay dung
D XmlTextWriter
110 All valid XML documents are well formed but not all well formed XML document
are valid.
111 Which of the following classes in System.XML namespace gives the tree
representation of the XML document, so that we can navigate through the entire
document and edit if required ?
A XmlReader
B XmlWriter----------------Cau nay dung
C XmlDocument
D XMLValidatingReader
112 The first parameter of XMLTextWriter specifies the filename which we have to
create, whereas the second parameter specifies ___________.
113 The class _____________ in System.XML is used to store, retrieve and manipulate
the relational Dataset.
114 Identify the 2 abstract classes from the list given below.
115 Which class will point you towards the innerdata of the XML document ?
A XMLInner
B XmlWriter
C XMLReader
D XMLNode ----------------Cau nay dung
116 Which of the following statements are true about the Reflection API? ( Choose 2)
A It can be used to effectively find all the types in an assembly and/or dynamically
invoke methods in an assembly. ----------------Cau nay dung
B IT cannot be used to manipulate other objects on the .NET platform.
C It can at times even be used to emit Intermediate Language code on the fly so that the
generated code can be executed directly. ----------------Cau nay dung
D The Reflection API uses the System.Reflection namespace, with the Reflection class
to identify the type of the Class being reflected,
117 Which of the following statements best illustrates the use of the Reflection API.
( Choose 3)
A Obtains Class and Type Information from an Assembly ----------------Cau nay dung
B Translates a stream of input characters into a stream of input elements
C Obtains Member Information from a Class ----------------Cau nay dung
D Dynamically Invokes Methods from Classes in an Assembly ----------------Cau nay
dung
118 Which of the following properties does the Type class have? (Choose 3)
A IsCLass
B IsMethod
C IsPublic ----------------Cau nay dung
D IsCOMObject ----------------Cau nay dung
122 Through which process does the assembly expose its Metadata ?
A Reaction
B Action
C Reflection
D Interaction
Comment(0 ý kiến)
A Self Describing
B Versioning ----------------Cau nay dung
C Reflection
A AttributeTargets.All
B AttributeTargets.Class
C AttributeTargets.AllClasses
D None of those
4 Which of the following statement/s with reference to Dllimport attribute is/are TRUE?
A TRUE
B FALSE
A Reflection
B Assembly
C Attribute
D Annotation
A TRUE
B FALSE
8 Descriptive information in the metadata can be extracted using runtime reflection
services
A TRUE
B FALSE
9 Attributes are stored with the metadata of the element they are associated with
A TRUE
B FALSE
A managed code
B unmanage code
C protected code
A Conditional
B Obsolete
C STAThread
D DllImport
A System.Diagnostics
B System.Runtime
C System.Runtime.InteropServices
D System.Runtime.Diagnostics
13 Which attribute is used to notify about a deprecated element
A Conditional
B Obsolete
C DllImport
D STAThread
A TRUE
B FALSE
A TRUE
B FALSE
A TRUE
B FALSE
A ResourceElements
B ResourceData
C AddResource
D ResourceWriter
A An Assembly
B A Manifest
C An Executable file
A .exe
B .dll
C .cs
D .ddl
A key.exe
B sn.exe
C snk.exe
D key.snk
A TRUE
B FALSE
A csc/out:/target
B csc /out:/library ----------------Cau nay dung
C csc /out:/target:library
D csc /out: /target: library
26 For versioning the private assemblies, the CLR simply loads the newest assemblies
found in the application directory.
27 Identify the correct syntax for creating an executable file referencing an assembly.
A Assemblies
B Manifest
C Reflection
D Delegates
33 If there is a change in the major number or minor number of the version number it
indicates that __s_____
34 The programmer has an assembly named pri.dll which other programmer also wants
used the same assembly.
Which of the following are the correct statements when executed will satisfy the above
needs.
A sn key1.snk
csc /out:pri.dll /target:library file2.cs /a .keyfile:key.snk
gautil -I pri.dll
B sn -k key1.snk
csc /out:pri.dll /target:library file2.cs /a .keyfile:key.snk
gautil pri.dll
C sn -k key1.snk
csc /out:pri.dll /target:library file2.cs /a .keyfile:key.snk
gautil -I pri.dll
36 The .net Framework SDK 2 provides the user with a tool called ___________ to
peek into the assemblies and explore the classes available within them.
A SN
B ILDASM ----------------Cau nay dung
C Explr
D Lock
37 Which one of the following statement/s with reference to Shared Assemblies is NOT
TRUE?
38 When we use a __________ assembly, the assembly file is not copied onto the
applications directory but remains in the GAC folder.
A Private
B Shared ----------------Cau nay dung
39 What does a change in the build number of the version number indicate?
A It indicates that the assembly maybe compatible with previous versions of that
assembly
B It indicates that a very minor change has been made to the assembly ----------------Cau
nay dung
C It indicates that the assembly is incompatible with previous versions of that assembly
Statement A: An assembly consists of a set of types and resources that form a logical
unit of functionality.
Statement B: An assembly consists of a manifest that contains information, which
describes the assembly.
A Statement 1 is true
B Statement 2 is true
C Both the Statements are true ----------------Cau nay dung
D Both the Statements are false
Statement B: Unlike the GAC, the Native Image Cache does not store assemblies in IL
format, but rather in their native machine dependent native code.
A Statement 1 is true
B Statement 2 is true
C Both the Statements are true ----------------Cau nay dung
D Both the Statements are false
42 The ________ Command Line Option is used to list assemblies from the GAC.
44 The _______ command in C# is used to view the content of Assemblies and the
manifest.
A csc.exe
B Resgen.exe
C ILDASM.exe ----------------Cau nay dung
D view.exe
A Metadata
B Type-Metadata
C IL-Metadata
D Resource-Metadata----------------Cau nay dung
A Assembly Metadata
B MSIL Code
C Type Metadata
D Resources
E GAC utility ----------------Cau nay dung
47 Which part of the assembly displays the picture file or sound file ?
A Assembly Metadata
B MSIL Code
C Type Metadata
D Resources ----------------Cau nay dung
48 Which file comes with .Net framework SDK to create a Resource file ?
A Resource.exe
B Resgen.exe ----------------Cau nay dung
C Region.exe
D Resin.exe
A Stream
B BinaryWriter ----------------Cau nay dung
C TextWriter
D StreamWriter
A Thread
B ThreadPool
C Monitor ----------------Cau nay dung
D Timer
60 ThreadStart is a _________
A interface
B class
C abstract class
D delegate ----------------Cau nay dung
E event
Comment(0 ý kiến)
13: How many CCWs are created by the runtime to manage more then one
COM client ?
(13: Làm thế nào CCWs được tạo ra bởi rất nhiều thời gian để quản lý nhiều
hơn thì một trong những khách hàng COM?)
[A]One CCW can handle any number of COM clients
[B]The number of CCWs is equal to the number of COM clients.
[C]Five CCWs are created to handle more then one COM clients.
22: The .net Framework SDK 2 provides the user with a tool called____to
peek into the assemblies and explore the classes available within them.
(The net Framework. SDK 2 cung cấp cho người sử dụng với một peek
called____to công cụ vào hội đồng và khám phá những lớp học có sẵn trong
chúng.)
[A] Lock [B] SN
[C] Explr [D] ILDASM
26: The TlbExp Utility creates the proxy for the COM Dlls,
[A] False [B] TRUE
27: In order to call a .NET component from a COM client you need to first
register the assembly using the ____ utility.
(Để gọi cho một thành phần. NET COM từ một khách hàng đầu tiên bạn cần
phải đăng ký lắp ráp bằng cách sử dụng tiện ích ____.)
[A] TlbExp
[B] RegAsm
31: Which one of the following classes allows you to transform documents
using stylesheets in XML?
(Mà một trong những lớp học sau đây cho phép bạn biến đổi các tài liệu sử
dụng trong XML stylesheets?)
[A]System.XML.Xpath
[B]System.XML.Style
[C]System. XML.Schema
[D] System.XML.Xsl
32: Which of the following statements are true about the Reflection API?
(Choose 2)
(Mà các báo cáo sau đây là đúng sự thật về API Reflection? (Chọn 2))
[A]It can at times even be used to emit Intermediate Language code on the fly
so that the generated code can be executed directly.
[B]It can be used to effectively find all the types in an assembly and/or
dynamically invoke methods in an assembly,
[C]IT cannot be used to manipulate other objects on the .NET platform.
[D]The Reflection API uses the System.Reflection namespace, with the
Reflection class to identify the type of the Class being reflected,
35: Which file comes with .Met framework SDK to create a Resource file ?
(Những tập tin đi kèm với SDK khuôn khổ. Met để tạo một tập tin tài
nguyên?)
[A]Resin.exe
[B]Resource.exe
[C]Region.exe
[D]Resgen.exe
36: The class_________ in System .XML is used to store, retrieve and
manipulate the relational Dataset
(Lớp _________ trong hệ thống. XML được sử dụng để lưu trữ, truy xuất và
thao tác các tập dữ liệu quan hệ)
[A]XMLTableDocument
[B]XMLDataDocument
[C]XMLRe lationa IDocu ment
45: Attributes are stored with the metadata of the element they are associated
with
(Thuộc tính được lưu với các siêu dữ liệu của phần tử chúng được liên kết
với)
[A] FALSE
[B] TRUE
47: (Một. NET cũng là thành phần được gọi là lắp ráp *)
A .NET component is also referred to as assembly*
[A] FALSE
[B] TRUE
48: When there are no more nodes to be read in the file, the XMLReader class
returns___
(Khi không có các nút nhiều hơn để được đọc trong tập tin, các lớp
XMLReader trả về _)
[A]FALSE
[B]EOF
[C]0
[D] 1
51: Which of the following properties does the Type class have? (Choose 3)
Trong đó các đặc tính sau đây không có lớp Loại? (Chọn 3)
[A]IsPublic [B]IsCLass
[C]IsMethod [D]IsCOMObject
53: Which term is used for the data conversion from Com to .Net ?
(thuật ngữ nào được sử dụng để chuyển dữ liệu từ Com vào Net?.)
[A]Data-conversion [B]Marshalling
[C]Type-casting [D]Marshaled
54: The__________command gives you the output of COM type library,
(Lệnh _________ cung cấp cho bạn các đầu ra của thư viện kiểu COM,)
[a]TlbLib [b]TlBExp
[c]TlBImp [d]TlBDet
56: The Timer class in the System Thread namespace provides a mechanism
for executing a method at________
(Lớp Timer trong không gian tên hệ thống Thread cung cấp một cơ chế để
thực hiện một phương pháp ở ________)
[A]specified time [B]specified intervals
57: Regardless of how many COM clients try to access the component the
runtime creates only one CCW for a managed .NET component
(Bất kể có bao nhiêu khách hàng COM thử truy cập vào các thành phần trong
thời gian chạy tạo chỉ có một bên trái cho một thành phần quản lý NET.)
[A] FALSE [B] TRUE
58: The .exe file in .Net can be executed from any platform.
(Các exe trong.. Có thể được thực hiện từ nền tảng nào.)
[A] FALSE [B] TRUE
6: _______method blocks the calling thread till the current thread ends
(_______ phương pháp khối sợi chỉ gọi điện thoại đến chủ đề hiện tại kết
thúc)
[A] Block() [B]IsAlive()
[C] Join() [D] Sleep()
63: .NET client and COM clients can simultaneously make calls to the
same .NET component.
(NET client. COM và khách hàng có thể đồng thời thực hiện cuộc gọi đến
cùng. Thành phần NET.)
[A] FALSE
[B] TRUE
Comment(0 ý kiến)
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
Answer: 4
2. How can you sort the elements of the array in descending order?
Select Answer :
1. Desc()
2. ASCReverse()
3. By calling Sort() and then Reverse() methods
4. By calling ascen() and then Reverse() methods
Answer: 3
3. What is boxing in .net ?
Select Answer :
1. Encapsulating an object in a value type.
2. Encapsulating a copy of an object in a value type
3. Encapsulating a value type in an object
4. Encapsulating a copy of a value type in an object
Answer: 4
4. Which of these string definitions will prevent escaping on
backslashes in C#?
Select Answer :
1. string s = #”n Test string”;
2. string s = “n Test string”
3. string s = @”n Test string”
4. string s = “n Test string”;
Answer: 3
5. The C# keyword ‘int’ maps to which .NET type ?
Select Answer :
1. System.Int16
2. System.Int32
3. System.Int64
4. System.Int128
Answer: 2
6. Which program control statements aways executes the internal
statements at least once?
Select Answer :
1. do{Statements}j=j+1;
2. if(j!=1){Statements} j = j+1;
3. while(j!=1){Statements} j=j+1;
Answer: 1
7. Which interface allows a collection to be navigated using the
foreach statement?
Select Answer :
1. IEnumerable
2. IUnknown
3. IEnumerator
4. Idisposable
Answer: 1
8. Which of these statements correctly declares a two-dimensional
array in C# ?
Select Answer :
1. int[,] myArray;
2. int[][] myArray;
3. int[2] myArray;
4. System.Array[2] myArray;
Answer: 1
9. What is the printout of the following ?
byte b1 =1;
byte b2 = 255;
byte total = b1+b2;
Console.WriteLine(total);
Select Answer :
1. We will get a runtime error
2. We will get a compilation err
3. 256
4. 1
Answer: 2
10. Multiple data type store in a System.Array?
Select Answer :
1. Yes
2. No
3. I don’t know
4. All the above
Answer: 2
11. Which is the main CLR System assembly which contains the
classes for built – in CLR types?
Select Answer :
1. base
2. mscorlib
3. 1&2
4. none
Answer: 2
12. How many classes can a single .NET DLL contain?
Select answer :
1. 1
2. many
3. 4
4. 5
Answer: 2
Answer: 3
Answer: 4
Answer: 4
Answer: 1
Answer: 4
Answer: 2
Answer: 1
Answer: 3
Comment(0 ý kiến)
Which of the following statements are true for the above code? [0.5]
a) one ,two ,three must be classes. c) one, two, three can be classes or interfaces.
b) Above code will generate an error as multiple values after the : is not allowed
in C#. d) one, two, three must be interfaces.
102. If Parent is a base class and child is its derived class then which of the
following statements are not valid? [1.0]
103. Any class that contain one or more abstract methods must be declared as
____ [1.0]
a) Interface c) Static
b) Abstract d) Private
104. Which of the following are correct statements for implementing an abstract
class. [1.0]
a) True b) False
111. What will be the output of the following code when compiled/run?
1. using System;
2. class Book{
3. void show(){
4. Console.WriteLine("In Book");
5. }
6. }
7. class storyBook:Book{
8. void show(){
9. Console.WriteLine("In Story book");
10. }
11. static void Main(){
12. Book b1=new storyBook();
13. b1.show();14. }} [1.5]
a) True b) False
114. What error does the following code generates when compiled?
1. abstract class Class
2. {
3. public void getNumber();
4. }
5. class ClassA:Class
6. {} [1.5]
a) The name of base class used is invalid c) The class ClassA must declare as
abstract as the class does not implements all the methods of abstract base class.
a) The name of base class used is invalid. c) The class ClassA must declare as
abstract as the class does not implements all the methods of abstract base class.
a) The code will generate an error, as the object p is not properly instantiated. c)
The output of the code will be:
1000
1000
b) The code will generate an error, as the object c2 is not properly instantiated d)
The output of the code will be:
1000
100
a) The code will generate an error, as the object p is not properly instantiated. c)
The code will generate a compilation error, as parent class does not have a
display method with one argument.
119. Which of the following statements are true with respect to a virtual method
[2.0]
1. class Room{
2. public bool isEmpty(){
a. return (true);
3. }
4. }
5. class StaffRoom: Room{
6. public new bool isEmpty(){
a. return false;
7. }
8. public static void Main() {
9. Room R1=new StaffRoom();
10. System.Console.WriteLine(R1.isEmpty());11. }} [2.0]
a) True c) False
b) The code will not compile and generate an error at line 6. d) The code will not
compile and generate an error at line 9.
121. 1. abstract class Class{
2. public abstract void getNumber();
3. public abstract void getHeight();
4. public bool isEmpty(){return (true);}
5. }
6. abstract class ClassA:Class{
7. public abstract void getWidth();
8. }
9. class ClassB:ClassA
10. { }
What changes should be done in the above code so that the code does not
generate any error at compile time? [2.0]
b) Remove the abstract modifier for the class ClassA d) Implement the methods
getNumber(),getHeight(), getWidth() in the class ClassB.
122. Which of the following statements are true with respect to abstract
functions? [2.0]
c) True, False
a) F() c) GG()
b) FF() d) G()
126. Using directives are provided to facilitate the use of namespaces. [0.5]
a) True b) False
a) Using c) System
b) Class d) Namespace
129. The “using” alias directives can be used to pull out and bring into scope one
component from a namespace. [0.5]
a) True b) False
130. The _______ namespace provides the classes and methods for manipulating
arrays. [0.5]
a) System.IO c) System.Array
b) System.Arr d) Array
a) Classes c) a namespace
132. The ________namespace contains all code required to interact with the
including the console output. [1.0]
a) IO c) Class
b) System d) Namespace
133. When a class is used inside its namespace, the _______ of that class is used.
[1.0]
b) Namespace name
134. _____ keyword is used to import the classes of the namespace [1.0]
a) using c) namespace
b) class d) import
a) Arraytosort.Sort() c) System.Array.Sort(Arraytosort)
b) Arraytosort.Array.Sort() d) System.Array.Sort()
136. Classes in the Base Class Library are categorized into ______ based on
their functionality. [1.0]
a) Assemblies c) Application
b) Directives d) Namespaces
a) class d) Interface
c) delegates
a) Space1.MyClass() c) Space1.Space2.MyClass()
b) Space2.MyClass() d) Space2.Space1.MyClass()
a) Shelf.Book() c) College.Library.Shelf.Book()
b) College.Library.Book() d) Library.Shelf.Book()
a) 3 c) 1
b) 2 d) 0
b) 2 d) 1
a) System c) System.Thread
b) System.Threading d) System.Synchronize
145. When the array is initialized at the same time they are created, the c#
compiler determines the size of array using ________ [1.5]
a) the default array size for each data type. c) the number of items in the
initialization list.
b) the compilers presetting for each data type array. d) The number present in the
square bracket next to the data type at the right hand side.
a) mscorlib.dll c) system.dll
b) Cdefault.dll d) namespace.dll
147. Which of the following statements are true? [2.0]
b) The dimension lengths are not part of the type of the array, but rather are
established when an instance of the array type is created at run-time. e) At run-
time, a value of an array type is null or a reference to an instance of that array
type.
148. Which of the following statements are true with respect to an Array type.
[2.0]
b) The System.Array type is the abstract base type of all array types e) The
members of an array are the members inherited from class System.Array.
a) The code will generate an error at compile time since the Sort() function of
Array returns an integer number. c) The output of code will be
3
2
1
1
2
3
150. What output does the code below generate when compiled/run?
1. class Employee{
2. public int EmployeeId;
3. public static Employee getEmpId(int EmpId){
4. Employee emp=new Employee();
5. emp.EmployeeId=EmpId;
6. return(emp);
7. }
8. }
9. class Test{
10. public static void Main(){
11. Employee[] emps=new Employee[2];
12. emps[0]=Employee.getEmpId(1);
13. emps[1]=Employee.getEmpId(2);
14. foreach(Employee e in emps)
15. System.Console.WriteLine(e.EmployeeId);16. }} [2.0]
a) The code will generate a null exception, as the employees are not initialized.
c) The code will generate a compile time error at line 12 and line 13.
Comment(0 ý kiến)
a) 0.0d b) 0.0m.
a) data can be stored using value types but not in the reference type. c) variables of the
reference types directly contain their data, whereas variables of the value types store
references to objects.
b) data in the value type variable is easily accessible. d) variables of the value types
directly contain their data, whereas variables of the reference types store references to
objects.
int x=0,y=4,z=5;
if(x<2)
if(y<4){
Console.WriteLine("One");
}
else {
Console.WriteLine("Two");
}
else if(z>5){
Console.WriteLine("Three");
}
else {
Console.WriteLine("Four");
} [2.0]
a) One c) Three
a) The code is illegal because of expression at line 4. b) The output would be only the
text “Two”.
b) The acceptable type for variable j as the argument to the switch () construct could be
any of byte, short, int or long. d) The output would be only the text “Two” followed by
the text “Two Two” followed by the text “2”.
a) The code is illegal because of expression at line 4. c) The output would be the text
“Two” followed by the text “Three”.
b) The output would be only the text “Two”. d) The output would be only the text
“Three” followed by the text “Two” followed by the text “2”.
a) The code will not compile because the switch statement does not have a legal
expression. c) The code will compile and run and the letter “A” will be written to the
standard output.
b) The code will compile and run but nothing will be return on the standard output. d)
The code will compile and run and the word “Default” will be written to the standard
output.
a) while(int i<7)
{
i++;
Console.WriteLine("Value of i is {0}",i);
} c) int j=0;
for(int k=0;j+k!=10;j++,k++)
{
Console.WriteLine("j= {0} k={1}",j,k);
}
b) int i=3;
while(i){
Console.WriteLine("Value of i is {0}",i);
} d) int j=0;
do{
Console.WriteLine("Value of i is {0}",,j);
if(j==3){continue loop;}
}while(j<10);
a) <3 c) Other
b) >2 d) No output
a) 4 c) The code does not compile because static method cannot access nonstatic
variables Var1 and var2.
61. If you run the following program what lines would be included in its output?
class A
{
public static void Main ()
{
int i=0;
switch (i) {
default:
System.Console.Write (i);
break;
case 1:
System.Console.Write ("{0}",1);
goto default;
case 0:
System.Console.Write ("{0}",0);
goto case 1;
}
}
} [2.5]
a) 100 c) 110
a) variable c) method
b) instance d) struct
63. The constructor without parameters is called _________. [0.5]
a) Only one c) no
b) One or more
65. The object invokes the default constructor when no parameters were passed to it.
[0.5]
a) True b) False
66. If a class has a static constructor then it is automatically called when the class is
loaded. Static constructors cannot be invoked explicitly. [0.5]
a) True b) False
a) static c) overridden
b) parameterized d) virtual
68. Which of the following sentences are true about Constructors? [1.0]
a) The constructor can have the same name as that of its class. c) The constructor may or
may not have name same as that of the name of its class.
b) The constructor can have the same name as one of the methods in the class. d) The
constructor must have the same name as that of the name of its class.
69. Which of the following methods can act as a constructor for the class “Object” that
is used to create an object. [1.0]
b) object(){} d) Object(){}
70. Which of the following methods can act as a constructor for the class “Employee”
that is used to create an object. [1.0]
72. Which of the following is a legal constructor for the class Test. [1.0]
b) Static constructors may or may not take parameters. e) A static constructor for a class
is called automatically when the object is accessed.
74. class A
{
public static int X = B.Y + 1;
}
class B
{
public static int Y = A.X + 1;
static void Main() {
Console.WriteLine("X = {0}, Y = {1}", A.X, B.Y);
}
}
what will be the output of above code? [1.5]
75. Which of the following statements are true with respect to Static constructors. [1.5]
b) Static constructors can have accessibility modifiers. e) Static constructors are called
when the class is loaded.
76. Which of the following methods can be used as a destructor for a class “myClass”.
[1.5]
b) MyClass() { } d) ~myClass() { }
77. The method that overrides a method in the base class must be prefixed with the ____
keyword. [1.5]
a) virtual c) Sealed
b) new d) Overridden
78. Which of the following statements is correct for a method, which is overriding the
following method: public void add(int a) {…}
Select the most appropriate answer [1.5]
a) the overriding method must return void c) the overriding method can return whatever
it likes
a) The code will generate no error. c) Incompatible type for ’=’ can’t convert SubClass
to SuperClass.
class Superclass { }
class Subclass1 extends Superclass { }
and these objects:
Superclass a = new Superclass();
Subclass1 b = new Subclass1();
which of the following explains the result of the statement:
b = a;
Select the correct statement. [1.5]
82. At least one _______ constructor must be declared to suppress the automatic
generation of a default constructor.
[1.5]
a) Default c) Private
b) Static d) Parameterized
83. Which of the following statements are true with respect to Static constructors ? [2.0]
c) The identifier of a constructor-declarator must not name the class in which the
constructor is declared.
a) Test(1)
Test(2)
Test(3) c) Test(2)
Test(1)
Test(3)
b) Test(3)
Test(2)
Test(1) d) Test(1)
Test(3)
Test(2)
85. Which of the following statements are true with respect to destructors. [2.0]
b) A class has no other destructors than those that are actually declared in the class. d)
Destructors are inherited.
86. Statement I: The sealed modifiers are not permitted in an enum declaration.
Statement II: Delegate types are implicitly sealed [2.0]
a) Init A
A.F
Init B
B.F c) A.F
Init B
Init A
A.F
b) Init
Init A
A.F
B.F d) A.F
B.F
Init B
Init A
b) Compilation error at line 13. d) No compilation error, but runtime exception at line
13.
90. Which of the following statements are true with respect to overloading. [2.5]
b) It is possible to overload solely based on return type or solely based on the inclusion
or exclusion of the params modifier. d) Unary operators cannot be overloaded.
a) Prints 100 and 999. c) Compilation error at line 2, variable maxElements was not
initialized.
class Super{
public int index = 5;
public virtual void printVal() {
System.Console.WriteLine( "Super" );
}
}
a) The code will not compile. c) The code compiles and "5, Sub" is printed on the
standard output.
b) The code compiles and "5, Super" is printed on the standard output. d) The code
compiles and "2, Super" is printed on the standard output.
93. Assume that Sub1 and Sub2 are both subclasses of class Super.
Which statement best describes the result of attempting to compile and execute the
following statement:
super = sub1;
[2.5]
a) Compiles and definitely legal at runtime c) Compiles and may be illegal at runtime
94. Which statements on the <<< call >>> line are valid expressions?
public class T {
public static void Main() {
int i;
float g;
SubClass b = new SubClass( );
<<< call >>>
} } [2.5]
a) b.m2(); c) i=b.x;
b) g=b.f; d) i=b.y;
95. Which of the following is a valid method declaration? [0.5]
96. The ______ declares a reference type that has abstract member only.
[0.5]
97. Abstract class cannot be directly instantiated but it can be used to create object
references. [0.5]
a) True b) False
a) True b) False
99. The ______ method is used to assign some value to a data member in a class. [0.5]
a) value c) get
b) set d) find
a) True b) False
a) Multi-platform b) Multi-language
a) True b) False
5. What is the role of the CLR (Select all that apply) [2.0]
b) Compiles program to a .exe file d) Compile once and run on any CPU & OS
that supports the runtime.
7. Select the two core technologies on which the .NET platform is based. [2.5]
a) True b) False
b) IP d) HTTP
10. The .NET platform is built on the following features of the Windows 2000
server family.(Select all that apply) [1.5]
a) Reliability c) Scalability
b) Security d) Manageability
a) Notification b) Personalization
14. Select the service, which allows users to maintain their schedules thus
facilitating timely and manageable interactions with other users. [1.5]
b) Personalization d) Calendar
15. ________ allows developers and business analysts work together to define
and modify business processes shared between applications. [1.0]
a) NGUS c) NGWS
b) MGWS d) NWGS
a) Private c) Public
b) Complete d) Restricted
a) // … // c) /** … **/
b) /*… */ d) / … /
19. The public keyword can be ignored for the Main function in C#. [1.0]
a) True b) False
a) True b) False
a) System c) Console
b) System.Output d) Console.System
a) Java c) C++
b) C d) VB
a) True b) False
25. Access Modifiers for variables in C# can be the following (Select all that
apply) [1.0]
a) Public c) Private
27. The prefix ______ enables the use of keywords as identifiers, which is
useful when interfacing with other programming languages. [0.5]
a) # c) $
b) & d) @
a) True b) False
29. What statement is used to completely abort the execution of a loop? [0.5]
a) continue d) break
b) goto e) exit
b) Character d) Integer
32. __________in simple terms is nothing but conversion of a value type into a
reference type. [1.0]
a) Casting c) Unboxing
b) Boxing d) Overriding
33. __________is all about converting a reference type into a value type. [1.0]
a) Overloading c) Unboxing
b) Boxing d) Casting
35. The _______class is the ultimate base class for all data types. [0.5]
a) Object c) Type
b) System d) Console
a) interact with the system environment c) interact with other classes in the
namespace
a) Class c) _Class
b) Class d) @class
39. Basic input and output operations are performed in C# using the methods of
the ______ class in the _________namespace. [1.0]
a) InputOutput,Class c) Console,System
b) InputOutput, System d) System,Console
40. C# provides an Unified Type System, which means that all data types are
derived from __________ class. [1.5]
a) System c) Variable
b) Object d) Class
a) Interface c) Struct
b) String d) Union
42. Which of the following will execute without errors at compile time. [1.5]
a) class Object{
static void main(){}
}
d) class Object{
public static Main(){}
}
b) class Object{
static void Main(){}
}
e) class Object{
static void Main(){};
}
c) Class Object{
static void Main(){}
}
a) void c) @void
b) _void d) _var
44. for(int i=0;i<2;i++){
for(int j=0;j<3;j++){
if(i==j) continue;
}
Console.WriteLine(“i={0} j={1}”,i,j);
}
Which lines would be the part of output? [1.5]
c) i=0 j=2
a) 4 c) The code does not compile because local variable is not initialized
correctly.
49. Array X and Y have integer data types. If these arrays are initialized
properly, what is wrong with the following statement?
for(int var=0;var<0;++var){
if(x[var]>100) break;
if(x[var]<0) continue;
x[var+1]=x[var]+y[var];
} [1.5]
a) It is illegal to have a break and continue statements within the same for
statement. c) The prefix operator is not allowed in the iteration part of a for
statement.
50. If you ran the following program what lines would be included in its output?
int var1,var2;
for(var1=0,var2=0;var1+var2<20;++var1,var2+=1)
{
Console.WriteLine(var1+var2);
} [1.5]
a) 5 c) 13
Comment(0 ý kiến)
int var1,var2;
for(var1=0,var2=0;var1+var2<20;++var1,var2+=1)
{
Console.WriteLine(var1+var2);
} [1.5]
a) 5 c) 13
b) 8 d) The program cannot compile because the for statement’s syntax is
incorrect.
51. using System;
class Test {
static void Main() {
int @Main;
int[] Static= new int[3];
@Main =100*Static[1]; Console.WriteLine(@Main);
}
}
What will be the output of above code? [2.0]
a) The code will return an error. c) The code will display 0.
b) The code will display 100. d) The code cannot compile.
52. For decimal, the default value is [2.0]
a) 0.0d b) 0.0m.
53. Value types differ from reference types as___ [2.0]
a) data can be stored using value types but not in the reference type. c) variables
of the reference types directly contain their data, whereas variables of the value
types store references to objects.
b) data in the value type variable is easily accessible. d) variables of the value
types directly contain their data, whereas variables of the reference types store
references to objects.
54. What would be the output of the following code fragment?
int x=0,y=4,z=5;
if(x<2)
if(y<4){
Console.WriteLine("One");
}
else {
Console.WriteLine("Two");
}
else if(z>5){
Console.WriteLine("Three");
}
else {
Console.WriteLine("Four");
} [2.0]
a) One c) Three
b) Two d) Code will generate an error;
55. Which statement is true about the following code fragment?
1. int j=2,a=1;
2. switch(j){
3. case 2: Console.WriteLine("Two");break;
4. case 1+a: Console.WriteLine("Two Two"); break;
5. default: Console.WriteLine(j);6. } [2.0]
a) The code is illegal because of expression at line 4. c) The output would be
only the text “Two”.
b) The acceptable type for variable j as the argument to the switch () construct
could be any of byte, short, int or long. d) The output would be only the text
“Two” followed by the text “Two Two” followed by the text “2”.
56. Which statement is true about the following code fragment?
int j=2;
switch(j){
case 2: Console.WriteLine("Two");break;
case 2+1: Console.WriteLine("Three");break;
default : Console.WriteLine(j);
} [2.0]
a) The code is illegal because of expression at line 4. c) The output would be the
text “Two” followed by the text “Three”.
b) The output would be only the text “Two”. d) The output would be only the
text “Three” followed by the text “Two” followed by the text “2”.
57. char c=’a’;
switch(c ){
case ‘a’: Console.WriteLine("A");break;
default: Console.WriteLine("Default");
}
What will happen if you attempt to compile and run code that includes this
snippet? [2.0]
a) The code will not compile because the switch statement does not have a legal
expression. c) The code will compile and run and the letter “A” will be written
to the standard output.
b) The code will compile and run but nothing will be return on the standard
output. d) The code will compile and run and the word “Default” will be written
to the standard output.
58. Which of the following is a legal loop constructions?
(Choose all that apply) [2.5]
a) while(int i<7)
{
i++;
Console.WriteLine("Value of i is {0}",i);
} c) int j=0;
for(int k=0;j+k!=10;j++,k++)
{
Console.WriteLine("j= {0} k={1}",j,k);
}
b) int i=3;
while(i){
Console.WriteLine("Value of i is {0}",i);
} d) int j=0;
do{
Console.WriteLine("Value of i is {0}",,j);
if(j==3){continue loop;}
}while(j<10);
59. int myVar=3;
if (myVar<5)
if(myVar<3)
Console.WriteLine("<3");
else if (myVar>2)
Console.WriteLine(">2");
else Console.WriteLine("Other");
What will appear on the standard output? [2.5]
a) <3 c) Other
b) >2 d) No output
60. Class Book
{
int num1=1;
int num2;
public static void Main(){
int num3=3;
Console.WriteLine(num1+num2+num3r);
}
} [2.5]
a) 4 c) The code does not compile because static method cannot access nonstatic
variables Var1 and var2.
b) 0 d) The code does not compile because Var2 is not initialized.
61. If you run the following program what lines would be included in its output?
class A
{
public static void Main ()
{
int i=0;
switch (i) {
default:
System.Console.Write (i);
break;
case 1:
System.Console.Write ("{0}",1);
goto default;
case 0:
System.Console.Write ("{0}",0);
goto case 1;
}
}
} [2.5]
a) 100 c) 110
b) 010 d) The program fails to compile.
62. A constructor is a special type of a _______ in a class. [0.5]
a) variable c) method
b) instance d) struct
63. The constructor without parameters is called _________. [0.5]
a) main constructor c) default constructor
b) zero valued constructor d) non-parameterized constructor
64. Static constructor has _______ parameter/s. [0.5]
a) Only one c) no
b) One or more
65. The object invokes the default constructor when no parameters were passed
to it. [0.5]
a) True b) False
66. If a class has a static constructor then it is automatically called when the
class is loaded. Static constructors cannot be invoked explicitly. [0.5]
a) True b) False
67. _______ enables the possibility for a function to be polymorphic when it is
overridden in one or more inherited classes. [0.5]
a) static c) overridden
b) parameterized d) virtual
68. Which of the following sentences are true about Constructors? [1.0]
a) The constructor can have the same name as that of its class. c) The constructor
may or may not have name same as that of the name of its class.
b) The constructor can have the same name as one of the methods in the class. d)
The constructor must have the same name as that of the name of its class.
69. Which of the following methods can act as a constructor for the class
“Object” that is used to create an object. [1.0]
a) void object(){} c) Object Object(){}
b) object(){} d) Object(){}
70. Which of the following methods can act as a constructor for the class
“Employee” that is used to create an object. [1.0]
a) void employee(int enmpno){} c) employee(int empno){}
b) Employee (){} d) Employee(int empno){}
71. Methods can be overloaded in C# by: [1.0]
a) specifying different return types. c) specifying different number of parameters
72. Which of the following is a legal constructor for the class Test. [1.0]
a) constructor Test(){ } d) void Test(int a, string s, int f)
b) Test() { } e) public Test(int a, int b){}
c) Test(int a, int b){}
73. Which of the following statements are true? [1.0]
a) A static constructor is a member that implements the actions required to
initialize a class. d) A static constructor cannot have accessibility modifiers.
b) Static constructors may or may not take parameters. e) A static constructor for
a class is called automatically when the object is accessed.
c) A static constructor can have public as a accessibility modifiers
74. class A
{
public static int X = B.Y + 1;
}
class B
{
public static int Y = A.X + 1;
static void Main() {
Console.WriteLine("X = {0}, Y = {1}", A.X, B.Y);
}
}
what will be the output of above code? [1.5]
a) X=0, Y=1 c) X=2, Y=1
b) X=1, Y=2 d) The code fails to compile.
75. Which of the following statements are true with respect to Static
constructors. [1.5]
a) Static constructors cannot take parameters. d) Static constructors can be called
explicitly or implicitly.
b) Static constructors can have accessibility modifiers. e) Static constructors are
called when the class is loaded.
c) Static constructors cannot be called explicitly. f)
76. Which of the following methods can be used as a destructor for a class
“myClass”. [1.5]
a) myclass() { } c) ~myClass(int I){ }
b) MyClass() { } d) ~myClass() { }
77. The method that overrides a method in the base class must be prefixed with
the ____ keyword. [1.5]
a) virtual c) Sealed
b) new d) Overridden
class Superclass { }
class Subclass1 extends Superclass { }
and these objects:
Superclass a = new Superclass();
Subclass1 b = new Subclass1();
which of the following explains the result of the statement:
b = a;
Select the correct statement. [1.5]
a) Illegal at compile time c) Definitely legal at runtime
b) Legal at compile time but possibly illegal at runtime
82. At least one _______ constructor must be declared to suppress the automatic
generation of a default constructor. [1.5]
a) Default c) Private
b) Static d) Parameterized
83. Which of the following statements are true with respect to Static constructors
? [2.0]
a) A constructor-declaration may include a set of attributes. d) A class has no
other constructors than those that are actually declared in the class
b) A constructor-declaration may include a valid combination of the four access
modifiers. e) Constructors are not inherited
c) The identifier of a constructor-declarator must not name the class in which the
constructor is declared.
84. What is the output of the following code?
class Super{
public int index = 5;
public virtual void printVal() {
System.Console.WriteLine( "Super" );
}
}
class Sub : Super{
int index = 2;
public override void printVal() {
System.Console.WriteLine( "Sub" );
}
}
Which statement best describes the result of attempting to compile and execute
the following statement:
super = sub1;
[2.5]
a) Compiles and definitely legal at runtime c) Compiles and may be illegal at
runtime
b) Does not compile
94. Which statements on the <<< call >>> line are valid expressions?
public class T {
public static void Main() {
int i;
float g;
SubClass b = new SubClass( );
<<< call >>>
} } [2.5]
a) b.m2(); c) i=b.x;
b) g=b.f; d) i=b.y;
95. Which of the following is a valid method declaration? [0.5]
a) public static virtual void Display() { } c) public void virtual Display(){}
b) public virtual void Display(){} d) public virtual static void Display() { }
96. The ______ declares a reference type that has abstract member only. [0.5]
a) static class c) Interface
b) abstract class d) Delegates
97. Abstract class cannot be directly instantiated but it can be used to create
object references. [0.5]
a) True b) False
98. An interface is a pure abstract class. [0.5]
a) True b) False
99. The ______ method is used to assign some value to a data member in a class.
[0.5]
a) value c) get
b) set d) find
100. public class A:B,C,D{ }
The above code represents ______ [0.5]
a) multilevel interface c) multiple interface
b) hierarchical interface d) multiple inheritance
Comment(0 ý kiến)
2. ____ is the main class for creating threads and controlling them
A. WaitHandle
B. Monitor
C. ThreadStart
D. ThreadPool
E. Thread
4. The . Net Frameword SDK 2 provides the user with a tool called ____ to peek into
the assemblies and explore the classes available within them.
A. Explr
B. Look
C. SN
D. ILDASM
5. The methods represented by ThreadStart can have zero, one or more parameters
A. Fasle
B. True
8. If the .NET component needs to be accessed from more than one application, the
.NET component then needs to be shared assembly and has to be installrd on the GAC
A. False
B. True
9. Which file comes with .NET frameword SDK to create a Resource file?
A. Region.exe
B. Resin.exe
C. Resource.exe
D. Resgen.exe
10. What is the command GacUtil / o NetClient.dll used for?
A. To compile the assembly
B. To store the assembly in the file
C. To generate an assembly containing metadata.
D. To enable the assembly to be shared among several applications
11. The ______ command gives you output of COM type library.
A. TLBDet
B. TLBExp
C. TLBLib
D. TLBImp
12. Multithread can help to improve application responsiveness
A. False
B. True
13. Identify the correct statement/s
A. Sta
14. Identify the 2 abstract classes from the list given below
A. XmlDocument
B. XmlTextWriter
C. XmlReader
D. XmlWriter
15. How many CCWs are created by the runtime to manage more then one COM client?
22. What does a change in the build number of the version number indicate?
A. It indicates that the assembly is incompatible with previous versions of that assembly
B. It indicates that a very minor change has been made to the assembly
C. It indicates that the assembly maybe compatible with previous versions of that
assembly
23. Which of the following classes in System.XML namespace gives the tree
representation of the XML document, so that we can navigate through the entire
document and edit if required?
A. XMLValidatingReader
B. XmlDocument
C. XmlWriter
D. XmlReader
24. A .Net component is also referred to as assembly
A. False
B. True
25. fdf
26. The ___ utility can be used to convert a COM Type Library into a .Net assembly
A. TlBDet
B. TLBExp
C. TLBLib
D. TLBImp
27. The TLBExp Utility creates the proxy for the COM Dlls
A. False
B. True
32. Only the Thread class can be used to create a thread object
A. Fasle
B. True
33. which one of the following statement/s with feference to Shared Assemblies is NOT
TRUE?
A. The shared assembly must have an identifier which makes it unique across the entire
system
B. Shared assemblies are the default type of assemblies
C. For a shared assembly to be used by many applications there should be no naming
clash
D. You must generate a new strong name for each and every shared assembly that you
wish to create
34. the start method in the Thread class stats immediately the thread execution
A. false
B. true
35. which of the following is/are not a part of the Assembly?
A. GAC utility
B. Type Metadata
C. MSIL Code
D. Resources
E. Assembly Metadata
36. Descriptive information in the metadata can be extracted using runtime reflection
services
A. False
B. True
37. fdf
38. one of the overloaded constructors of the XmlTextWriter takes in two parameters;
the first being the filename for the XML text file that is to be created and the second is
the ____
A. Version No.
B. EnvironmentPermission
C. Encoding style
D. File path
39. Which class will point you towards the innerdata of the XML document?
A. XMLReader
B. XMLNode
C. XMLInner
D. XmlWriter
40. identify the sytax of the GetDirectories method of System.IO.Directory class/
A. arr1[] getDirectories();
B. string[] GetDirectories(stringPath);
C. void GetDirectories(stringPath);
D. string GetDirectories();
41. Attibutes are stored with the metadata of the element they are associated with
A. False
B. true
42. which statement is FALSE about custom attribute?
A. A metadata cannot be extracted by another application
B. A custom attirbute class cannot be declared as private
C. A custom attibute class should inherit from System.Attributes class
43. err
44. The StreamReader class is the superClass of the class TextReader?
A. False
B. True
45. The Runtime Callable Wrapper does not contain any form of business logic
A. False
B. True
46. which of the following properties does the Type class have? (Choose 3)
A. IsCOMObject
B. IsClass
C. IsPublic
D. ¬¬IsMethod
47. Which term is used for the data conversion from Com to .Net?
A. Marshaled
B. Marshalling
C. Data-conversion
D. Type-casting
48. _____ is a concept which allows only one thread to excusively access particular
sections of code at a time
A. Thread pooling
B. Locking
C. Reentrant
49. what is the purpose if the Eixsts method of System.IO.Directory class?
A. No such method exists
B. It gets the current directory
C. It checks whether the given path refers to an existing directory
D. It checks whether the directory exists and deletes it/\.
50. when there are no more nodes to be read in the file, the XMLReader class
returns___
A. EOF
B. 0
C. FALSE
D. 1
51. ___ is a mechanism to implement thread management
A. Immutable object
B. Thread pooling
C. Critical section
D. Locking
52. Version number of an assembly are stored in the follwing format
A. <>
53. The extension of an assembly is ______
A. .ddl
B. .exe
C. .cs
D. .dll
54. Which part of the assembly displays the picture file or sound file?
A. Type Metadata
B. Assembly Metadata
C. MSIL Code
D. Resources
55. Namespace ___ is mandatory foor using DllImport attribute
A. System.Runtime.Diagostics
B. Systen.Runtime.InteropServices
C. System.Runtime
D. System.Dianostics
56. A key pair is created using the ______ utility
A. Key.snk
B. Key.exe
C. Snk.exe
D. Sn.exe
57. fdfdfdf
58. For versioning the private assemblies, the CLR simply loads the newst assemblies
found in the application directory
A. False
B. True
59. in order to call a .Net component from a COM client, you need to first register the
assembly using the ____ utility
A. TlbExp
B. RegAsm
60. A portion of code which is accessed by multiple threads at the same time is called
___
A. Immutable object
B. Critical section
C. Reentrant
61. The information about a class can be found out using ___
A. Reflection
B. Delegates
C. Assemblies
D. Manifest
62. ______ is the Proxy used by .Net to interact with COM.
A. Executble Callable Wrapper
B. Runtime Callable Wrapper
C. Route Callable Wrapper
63. When an object of the COM component is created in a .Net managed environment;
how is the object destroyed?
A. This issue is addressed by the RCW
B. The object is destroyed when the count reaches zero
C. The object is destroyed by the CLR
64. Which of the following statements are true? (Choose 2)
A. Private assemblies are stored in the same folder as that of an applicaton
B. Assemblies can be shared by installing it in the global Assembly Cache
C. Private assemblies should not be installled in subfolders below the executables folder
Comment(0 ý kiến)
A. Thread Synchronization
B. Join
C. Thread Waiting (correct answer)
A. Monitor
B. Timer
C. ThreadPool
Q.4) Contains operating system-specific objects that wait for access to shared
resources.
A. TimeOut
B. WaitHandle
C. Thread
Q.5) This retrieves a value which indicates whether a thread belongs to the
managed thread pool.
A. IsAlive
B. ManagedThreadId
C. IsThreadPoolThread (your answer)
D. ThreadState
A. IsAlive
B. CurrentThread
C. ThreadState
Q.7) Retrieves a value which contains the state of the current thread.
A. CurrentThread
B. ThreadState
C. IsAlive (correct answer)
Q.9) This method blocks the calling thread till the thread ends.
A. Sleep
B. Start
C. Join (your answer)
D. Interrupt
Q.10) This method obstructs the current thread for the specified time.
A. Join
B. Sleep
C. Abort
Q.11) A Thread must be in the Running state before the operating System
can schedule it.
A. Highest
B. Normal (your answer)
C. AboveNormal
D. Lowest
A. XQuery
B. XPath (correct answer)
C. SXLT
D. SLT
A. a node set
B. a integer value
C. a boolean
D. a String and a number
A. 1-2-3-4-5
B. 3-1-2-4-5
C. 4-1-2-3-5
D. 4-1-3-2-5 (correct answer)
Q.16) This is an abstract class that provides a cursor model for navigating
and editing XMl data.
A. XPath
B. XQuery
C. XEdit
D. XPathNavigator (correct answer)
A. [AttributeName(parameters)]
Element_Name(parameter){//Implementation}
B. [AttributeName(parameters)];
Element_Name(parameter){//Implementation}
A. DLLImport
B. Conditional (correct answer)
C. Obsolete
A. DLLImport
B. System.Diagnostics
C. Unmanaged Code
A. System.DLLImport
B. System.Runtime.InteropServices (correct answer)
C. System.Diagnostics
A. Conditional Attribute.
B. System.Diagnostics (your answer)
C. System.Runtime.InteropServices
Q.25) A DLL is a library that contains code and data that can be used by
more than one program at the same time.
A. True
B. False
Q.26) This is a phrase for complications which arise when working with
dynamic link libraries.
A. DLLs
B. DLL Hell
C. DLLImport
Q.27) These are the building blocks used by the .Net Framework used to
solve the versioning and deployment problems posed by the DLLs
A. Assemblies
B. Attributes
C. XPath
D. Custom Attributes
A. Collection
B. Attribute
C. DLLs
D. Assembly (correct answer)
Q.29) This is deployed with an application and is available only for the
application.
A. A public assembly
B. A private assembly (correct answer)
C. A Shared assembly
D. A protected assembly
A. DLLs
B. Assembly Metadata
C. Type Metadata
D. Dll Hell
E. MSIL Code & Resources
Q.31) A namespace can contain one or more assemblies and an assembly can
contain one or more namespaces.
A. Multiple applications can not implement the same DLL file due to
versioning problem
B. DLLs use fewer resource (your answer)
C. Modular programs cannot be built using Dynamic Link Library (your
answer)
D. Applications must be self describing so that they are no longer dependent
of the registry entries. (your answer)
A. Type metadata
B. Assembly metadata (correct answer)
C. MSIL Code
Q.34) File such as JPEG, text, XML and other types that are used in the
application.
A. MSIL Code
B. Resource (your answer)
C. Multifle Assembly
A. Assembly Metadata
B. Type Metadata (correct answer)
A. Assembly
B. MSIL Code
C. Resource
Q.37) The System.IO namespace in .Net does not support stream handling.
A. True
B. False (your answer)
Q.39) This class reads primary data types as binary values in a specific
encoding.
A. TextReader
B. BinaryReader
C. FileStream
Q.40) This class provides methods for creating, moving and enumerating
through directories and sub-directories.
A. DirectoryInfor
B. Directory
C. MemberInfor
Q.41) This class provides instance methods for creating, moving and
enumerating directories and sub-directories.
A. DirectoryInfor
B. Directory
C. File
Q.42) This class provides static methods for creating and manipulating files.
A. FileStream
B. File
C. FileInfor
D. FileSystemInfor
Q.43) This class contains methods that are common to file and directory
manipulation.
A. Stream
B. FileSystemInfor (correct answer)
C. FileInfor
D. File
Q.44) The TextReader class represents a reader that can read a sequence of
characters.
A. True
B. False
Q.45) This class is used to read and write data to memory instead of a disk.
A. BufferedStream
B. MemoryStream
C. FileStream
D. CrypttoStream
Q.46) This class is not part of the system.IO namsepace, It resides within the
System.security.
A. NetWorkStream
B. CryptoStream
Q.48) This class can be used for operations such as creating, copying,
moving, deleting and appending to files.
A. FileStream
B. FileInfor (correct answer)
C. File
D. FileManipulate
A. CreateDirectoryInfor();
B. CreateDir();
C. CreateDirectory()
Q.51) This method of Directory class is also used to rename the directory.
A. Rename();
B. Move();
C. Delete();
D. ReMove();
A. GetDirectories
B. GetDirectory
C. GetCurrentDirectory
A. GetDirectoties
B. GetCurrentDirectory
C. SetCurrentDirectory
A. FullName
B. CreateDirectory()
C. Move()
D. MoveTo()
E. Create()
A. 1-2-3-4-5-6
B. 2-4-5-6-1-3
C. 3-2-1-4-5-6
D. 3-1-4-5-6 (correct answer)
Q.56) Only the Thread class can be used to create a thread object.
A. True
B. False
A. Locking
B. Reentrant
C. Critical Section (correct answer)
D. Thread Pooling
Q.58) This object that does not change its state after it is create.
A. Thread object
B. Immutable object (correct answer)
C. pool object
A. Locking
B. Interrupt
C. Reentrant (correct answer)
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);
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.
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
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 ?
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
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: 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
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
28. Which of the following keywords are associated with iteration statements?
A. case
B. foreach
C. switch
D. while
Comment(0 ý kiến)
Answer: 3
22. Which operating system has the .NET Framework and Common Language
Runtime(CLR) natively installed?
Select answer :
1. Windows .NET Enterprise Servers
2. Windows XP Professional
3. Windows XP Home Edition
4. Windows 9x
5. Windows 2000
Answer: 2
Answer: 4
Answer: 1
Answer: 2
Answer: 2
Answer: 1
Answer: 5
30. What is the output of following C# code?
class MainClass
{
static void Main()
{
int i = 10 ;
uint j =2 ;
i = i + j;
System.Console.Write(i);
}
}
Select Answer :
1. Throws ‘InvalidCastException’
2. 12
3. Syntax Error[Cannot implicitly convert type ‘long’ to ‘int’]
4. Syntax Error [Cannot implicitly convert type ‘int’ to ‘uint’]
5. Syntax Error [Cannot implicitly convert type ‘uint’ to ‘int’]
Answer: 3
Answer: 2
Answer: 3
Answer: 1
Answer: 5
Answer: 2
Answer: 2
Answer: 5
Answer: 2
Answer: 3
Answer: 2
Answer: 3
Answer: 3
Answer: 2
44. A character in C# is an
Select Answer :
1. signed 32 bit integer
2. unsigned 16 bit integer
3. signed 16 bit integer
4. Unsigned 32 bit integer
Answer: 2
Answer: 1
Answer: 2
47. Which of the following are value types? (Choose all that apply.)
A. Decimal
B. String
C. System.Drawing.Point
D. Integer
Answers: A, C, and D
48. You pass a value-type variable into a procedure as an argument. The
procedure changes the variable; however, when the procedure returns, the
variable has not changed. What happened? (Choose one.)
49. With strict conversions enabled, which of the following would allow an
implicit
conversion? (Choose all that apply.)
A. Int16 to Int32
B. Int32 to Int16
C. Int16 to Double
D. Double to Int16
Answers: A and C
Comment(0 ý kiến)