Tuesday 27 December 2011

100.which of the following are true of the system.text.StringBuilder class?

A.it is less efficient than string concatenation when many concatenation are performed
B.There is a method which formats the string being appended to the stringBuilder, much like the string format
C.The StringBuilder is most efficient when initialized using the parameterless constructor
D.All of the above
E.None of the Above.
Ans:B

99.Which of the following are true of ADO.NET?

A.it uses a connected provider model
B.it uses a Disconnected provider Model
C.it includes a dataAdapter class, which provides a high-performance mechanism for retrieving data
D.system.data.common provides classes that are database agnostic
Ans:A&B

98.which of the following mechanisma are not suitable for returning a single row froma datatablecontaining a large number of records?

A.Datatable.rows.find (Correct)
B.Datatable.rows.select
C.Datatable.select
D.Enumerating across datatable.rows
Ans:A

97.which of the following are true about anonymous types?

A.They can be dervied from any reference type
B.Two anonymous types with the same named parameters in the same order declared in differentclassed have the same type
C.Anonymous types can have methods
D.All properties of an anonymous types are read/write
E.Anonymous types cannot cross method boundaries
Ans:A

96.Determining the availablity of sufficient memory for an operation can be accompished by

A.There is no supported application level means to determine if a specfic amount of memoryis available
B.using static methods of system.runtime.memoryfailpoint and checking the return value
C.creating an instance of system.runtime.memoryfailpoint and monitoring for an insuffcientMemoryException
D.Creating an instance of system.runtime.memoryfailpoint and monitoring for an outofmemoryException
Ans:C

95.Which of the follwoing elements can be adjusted when using the processModel element of the Machine.Config File ?

A.The number of queued requests befoer returning "Server Busy (error: 503)"
B.The maximum number of threads per processor
C.The maximum number of threads per request
D.The Maximum amount of memory utilized per request
Ans:D

94.with Which class is the task of mapping a specfic point in time into units such as weeks, months and year accomplished?

A.System.datetime
B.System.timeSpan
C.System.Globalization.Calender
D.System.Globalization.CultureInfo
Ans:A

93.which of the following can one use to detect the user's current language?

A.Examining the user languages property of the current request object
B.Examining the currentCulture property of the current request object
C.Examining the CurrentCulture property of the current thread Object
D.Examining the language property of the current page object
Ans:C

91. You and a friend from college, who works at a company across town, get together for dinner. You explain that you are in the middle of a VB 6-to-VB.NET migration and indicate that it is a bit of a challenge. Your friend says, "You should've just migrated to C#. It's cheaper and easier." Is your friend right?

A.Yes
B.No
Ans:B

92.Which of the following are true about Extension methods?

A.They must be declared static
B.They can be declared either static or instance members
C.they must be declares in the same assembly(but may be in different sources files)
D.Extension methods can be used to override existing instance methods
Ans:A&D

89. Data query building can sometimes be a bone of contention for VB 6 developers, since it involves SQL or XQuery. Microsoft is introducing a series of changes to the .NET Framework, such as a unified programming model for querying objects, databases and XML, that should make data queries much easier. What is the name for this set of technologies?

A.Rosario
B.Orcas
C.Yukon
D.LINQ
Ans:D

90. When Visual Studio 2005 and SQL Server 2005 were introduced to the world, Microsoft decided to revamp its certification process. Once Windows Vista is released, the titles of Microsoft Certified Professional (MCP), Microsoft Certified Application Developer (MCAD), and Microsoft Certified Solution Developer (MCSD) will no longer apply. Which of the following titles is NOT a category in Microsoft's new three-tiered certification framework?

A.Microsoft Certified Application Developer
B.Microsoft Certified Technology Specialist
C.Microsoft Certified Architect
D.Microsoft Certified IT Professional
Ans:A

88.As expected, Visual Basic 2005 comes with lots and lots of improvements over VB 6 and VB 2003. Which of the following is NOT out-of-the-box functionality in Visual Basic 2005?

A.Refactoring
B.Debugger ToolTips
C.Code snippets
D.Snap lines for graphical form-building
Ans:A

87.This programming language model is used sparingly in VB 6 but is one of the cornerstones of VB.NET. Knowing the ins and outs of it will make an application migration project easier and also prepare you for additional work in VB.NET. What is the model?

A.Modular programming
B.Aspect-oriented programming
C.Object-oriented programming
D.Reflective programming
Ans:C

86. Which of the following is the LEAST compelling reason to migrate an application from Visual Basic 6 to Visual Basic .NET?

A.You want to take advantage of ASP.NET features such as its caching abilities.
B.The application relies heavily on third-party controls or dynamic link libraries (DLLs).
C.The application's original developers were new to Visual Basic and/or used some "out of the box" development approaches.
D.Your company's business processes do not change all that often.
Ans:D

85.Does the Visual Basic Upgrade Wizard support ASP to ASP.NET migrations?

A.Yes, in all cases.
B.Yes, in some cases.
C.No, not at all.
Ans:C

84. True or False: The Visual Basic Upgrade Wizard will convert all the code in your VB 6 application to VB.NET code for you?

A.True
B.False
Ans:B

83.Some bits of a Visual Basic 6 application, like most APIs, can be easily migrated to VB.NET; other parts are not so straightforward. Which of the following will NOT have to be re-architected during a VB 6-to-VB.NET migration?

A.DHTML pages
B.ActiveX documents
C.OLE controls
D.ADO to ADO via Interop
Ans:D

81.Can you create Windows Services using VB.Net

 A.Yes
 B.No
 C.Not always
 D.None of these
ANS:A

82.If you know you want to migrate your Visual Basic 6 application to VB.NET, what is the first thing you should do?

A.Open the Visual Basic Upgrade Wizard, get a cup of coffee and watch it run.
B.Assess the VB 6 application; find out what controls it uses, what projects are in there and so on.
C.Cancel all social plans for the next couple months and start rewriting the app in .NET.
D.Schedule meetings with end users to see what features they want to add to the app.
Ans:B

80.How do you enable Strict Type Checking in VB.NET?

 A.With OPTION STRICT ON keyword
 B.With OPTION EXPICIT Keyword
 C.With OPTION STRICT OFF keyword
 D.All the above
ANS:A

79.How do you Create Constructors in VB.NET ?

 A.Create a method and name it with the same name as class name
 B.Create a method and which is named as New
 C.Create a method and which is named as Initialize
 D.None of the above
ANS:B

78.How do you Dereference an Object in VB.NET ?

A.By setting the object to Null
B.With Close keyword
C.By setting the object to Nothing
D.None of the above
ANS:C

77.How does VB.NET instantiates the .NET object?

A.Using NEW keyword
B.Using CREATEOBJECT keyword
C.Using GETOBJECT keyword
D.Both A & B
ANS:A

76.Select the keyword used to refer the name space in our code in VB.Net?

 A.Using
 B.Package
 C.Imports
 D.None of the above
ANS:C

75.To determine the folder in which your application is placed you can use:

A.My.Computer.CurrentFolder
B.My.Application.CurrentFolder
C.My.System.CurrentFolder
D.All the above
ANS:B

74.My.Application.Log.WriteEntry , by default , writes to the file:

A.Applog.Log
B.Application.Log
C.assemblyname.log
D.None of these
ANS:C

73.The metadata stored in the assembly is called :

A.AssemblyInfo
B.manifest
C.AssemblyData
D.None of these
ANS:B

72.Classes from which namespace will have to be used to read or write to a file ?

A.System.FileObjects
B.System.FileSystem
C.System.IO
D.System.Input/Output
ANS:C

71. What’s the difference between a class field property ?

A.A field always has Get and Set Methods
B.A property always has Get and Set Methods
C.Both 1 and 2
D.None of the above
ANS:B

70. A ‘for’ loop will run faster in VB.NET or C# ?

A.VB.NET
B.C#
C.Both of them will run equally fast.
D.None of these
ANS:B

69.which program will you use to assemble a program written in IL:

A.ildasm
B.clr
C.ilasm
D.All the above
ANS:C

68.The vbc.exe compiler generates:

A.IL Code
B.Native code
C.Byte Code
D.None of these
ANS:A

67. Can a toolbar display text instead of pictures in the buttons ?

A.No, a toolbar can only display images
B.No, a toolbar can only display text
C.Yes, a toolbar can display text, images, or both.
D.None of these
ANS:C

66. What two controls are needed when creating a toolbar ?

A.Only Toolbar control
B.ImageList and Toolbar control
C.Both 1 and 2
D.All the above
ANS:B

65.This programming language model is used sparingly in VB 6 but is one of the cornerstones of VB.NET. Knowing the ins and outs of it will make an application migration project easier and also prepare you for additional work in VB.NET. What is the model ?

A.Modular programming
B.Aspect-oriented programming
C.Reflective programming
D.Object-oriented programming
ANS:D

Sunday 25 December 2011

64.The Visual Basic Upgrade Wizard will convert all the code in your VB 6 application to VB.NET code for you?

A.False
B.True
C.Not always
D.Can't say
ANS:A


63. Some bits of a Visual Basic 6 application, like most APIs, can be easily migrated to VB.NET; other parts are not so straightforward. Which of the following will NOT have to be re-architected during a VB 6-to-VB.NET migration ?

A.DHTML pages
B.ADO to ADO via Interop
C.ActiveX documents
D.OLE controls
ANS:B

62. If you know want to migrate your Visual Basic 6 application to VB.NET, what is the first thing you should do ?

A.Schedule meetings with end users to see what features they want to add to the app.
B.Open the Visual Basic Upgrade Wizard, get a cup of coffee and watch it run.
C.Assess the VB 6 application; find out what controls it uses, what projects are in there and so on.
D.Cancel all social plans for the next couple months and start rewriting the app in .NET.
ANS:C

61. Vb.Net classes can be derived in C#


A.   True
B.   False
Ans:A

60. Which of the following is not a method of Debug class


A.   Assert( )
B.  Open()
C.  Flush( )
Ans:B

59.The serialization of an Object means that it is written out to a stream


A.  True
B.  False
Ans:A

58.How you refer the parent class in VB.Net


A.   Parent
B.  MyBase
C.  Super
 Ans:B

57. How do you refer the current class in VB.Net


A.   Me
B.   This
 C.   Super
Ans:A

56.How do you add Web Methods in VB.Net


A.   Add keyword to Method signature
B.  Add [WebMethod] on top of the Method Signature
C.  Add {WebMethod} on top of the Method Signature
Ans:A

55.The tool provided with .Net framework to register assemblies for use by COM is


A.   Regsvr32
B.   Regasm
C.   ILDASM
 D.  Regedit
Ans:B

54.Which of the method is used to display the form as modal


A.   Showdialog( )
B.   Activate ( )
C.  Loaddialog()
 D.   Show( )
Ans:A

53.The DataAdapter uses which of the following object to retrieve the data from database


A.  Connection
B.   Command
C.   DataReader
Ans:B

52.Which is the best to retrieve Read-Only, Forward-only stream of data from database


A.   Data Set
B.  Typed Data Set
C.  DataReader
Ans:C

51.Which is the base class for TypedDataset


A.   DataReader
 B.   Dataset
 C.   DataAdapter
Ans:B

Saturday 24 December 2011

50.Which method of the XMLdocument class takes xml as string while loading


A.   Loadxml ( )
 B.   Load( )
 C.  Save ( )
 Ans:A 

49.Where do you find COMException class


A.   System.Runtime.Interopservices
B.   System.XML
C.   System. Data
Ans:A

48.How do we implement private interfaces


 A.  Using Inherits Keyword
 B.  Private interfaces can not be implemented
 C.  Using Implements Keyword
 Ans:B 

48.How do we implement private interfaces


 A.  Using Inherits Keyword
 B.  Private interfaces can not be implemented
 C.  Using Implements Keyword
 Ans:B

47.How do you call non shared methods of a class


A.   Directly invoking the method name
B.  Invoking the method through the instance of that class
C.   None of the above
Ans:B 

46.Which interface allows to implement the Dispose method to do cleanup work


A.   Idestructor
B.  Icleanup
C.  Idisposable
 Ans:B

45.The constructors in VB.Net is similar to which event in previous versions of VB


A.   Class_Load
B.  Class_Terminate
C.  Class_Initialize
Ans:C

44. How do you create a Read only Property in VB.NET


A.   Using Only Get..EndGet with in property definition
B.   Using Only Set..EndSet with in property definition
C.  Using both Get and Set
Ans:A

43. How do you terminate code execute with in a VB.NET method_________?


A.  Exit
B.  Close Sub
C.  Exit Sub
 D. Kill
Ans: C

42. The methods which return the values back to the calling code are called as__________?


A.   Constructors
B.   Interrogative methods
C.   Imperative methods
Ans: B 

41. Methods declared with the following modifier are not accessible outside the class?


A.   Private
B.   Protected
C.  Friend
D.  Global
Ans:A 

40. Which of the following class does not belong to Collection namespace


 A.   ArrayList
 B.   Queue
 C.   DictionaryList
 D.   Stack
 Ans:C

39.What is the significance of Option Explicit statement when it is set to On?

A.   Specifies that any variable name is declared (with type) before use
B.   Specifies whether strings should be compared as binary
C.   Specifies that variables should be initialized before use
Ans:A

38. Which of the following Types will have data of fixed size?


A.  Value Type
B.   Reference Type
C.  None
Ans:A

37. Every type supported by CTS is derived from __________?


A.  System .Object
B.   System .Type
C.   System .Data
Ans:A 

36. An Assemblyinfo file in a VB.NET project will have blank as file extesion?


A.   .config
B.   .vb
C.  .cs
Ans: B

35. Most of the underlying integration of .NET is done through XML


A.   True
B.   False
Ans: A 

34. How many levels of compilation happens in .NET Framework?


A.   One
B.   Two
C.   Three
Ans:B

33. Which of the following namespaces is used to access "computer name" and its IP address in VB.NET?


A. System.NET.DNS
B. System.Diagnostics.Process
C. System.Data.Common
D. None of the Above
Ans:A

32. Which class is used to run the EXE application file in VB.NET?


A. Process
B. Application
C. Exe
D. Execute
Ans:A

31. Smart Phone applications and other such devices can be written using:


A. .NET Compact Framework
B. .NET Small Framework
C. .NET Smartclient Framwork
Ans:A

30. How to dereference an object in VB.NET?


A. By setting the object to Null
B. By setting the object to Nothing
C. With Close keyword
D. None of the above
Ans:B

29. ________ can be accessed from all types within the assembly, but not from outside the assembly?


A. Public
B. Private
C. Friend
D. Protected
E. Protected Friend
Ans:C

28. Using ___________ we can determine if a variable is initialized in VB.NET?


A. IsDdNull( )
B. IsEmpty( )
C. ISNull( )
Ans:A

27. Which one of the following collections receives output from Trace and Debug classes?


A.  Trace
B.  Debug
C.  Listeners
D.  None
Ans:C

26. In VB.NET, the finalizer must use the Overrides keyword?


A. True
B.  False
Ans:A

25. What is the purpose of Invoke Method?


A. Used to call any procedure
B. Used to call the procedure through Delegate variable
C. Both
D. None
Ans:B

24. Which NameSpace is used to access the metadata in an Assembly?


A. System.XML
B. System.Assembler
C. System.Reflection
D. System.IO
Ans:C

23. Which of the following is not correct about the value types and reference types in VB.NET?


A.  Dim statement is used to create a variable that represents a value type
B.  Data associated with a value type is allocated on the stack
C.  Reference types must be instantiated after declaration
D. Data associated with a reference type is allocated on the stack
Ans:D

22. Lower bound value of array in VB.NET?


A.  -1
B.  0
C.  2
D.  3
Ans:B

21. The smallest unit to which one can associate a version number in .NET is


A. CLR
B. Assembly
C.Namespace
D. None of the Above
Ans:B

20. Which of the following namespace provides support for obtaining information and dynamic creation of types at runtime?


A. System.IO
B. System.ComponentModel
C. System.Reflection
D. System.Data
Ans:D

19. which of the following is true about VB Generics?


A. VB Allows non-type template parameters
B. VB supports explicit specialization
C. VB allows the type parameters to be used as the base class for the generic type
D. VB allows a generic type parameter itself to to be a generic
E. VB enforces that all codes are valid for all types of parametrs
Ans: E

18. If no access modifier is specified for a class, it is considered _______?


 A. Public
 B. Private
 C. Friend
 D. Protected
Ans:A

17. Which of the following is not true for Shared members?


 A. Shared members belong to the type but not to any instance of a type
 B. They can be accessed without creating an instance of the type.
 C. They can be accessed using the type name
 D. They are accessed using instance name
Ans:D

Saturday 17 December 2011

16. Which of the following control doesn't receive the focus and doesn't have a TabIndex property?


A. PictureBox
 B. LablControl
 C. ListBox
 D. TabControl control
Ans:A

15. Which of the following object is used by the DataAdapter to retrieve the data from database?


A. Command
 B. Connection
 C. DataReader
Ans:A

14. Which of the following control can contain other controls?


A. GroupBox
 B. TabPage
 C. Panel
 D. All of the above
Ans:D

13. Which of the following is not the member of System.Collections?

A. BitArray
 B. Enum
 C. Queue
 D. Stack
Ans:B

12. Choose the correct statement about a delegate in VB.NET?


 A. A delegate is a strongly type function pointer
 B. It is a type-safe function pointer
 C. Delegates are used to create associations between events and event handlers in VB.NET
 D. All of the above statements are correct for a delegate
Ans:D

11. Is the Class type in VB.NET a value type?


 A.Yes
 B. No
Ans:B

10. How do you limit implicit type conversion in VB.NET?


 A. Option Strict On
 B. Option Strict=1
 C. Options Strict True
 D. Option Strict off
Ans:A

9. Default properties are always a parameterized property?


A.True
 B.False
Ans:A

8. The methods declared with the following modifiers are not accessible out side the current VB.NET project


 A. Public
 B. Protected
 C. Friend
Ans:C

7. COMException class is a part of ________?


 A. System.Runtime.Interopservices
 B. System.XML
 C. System. Data
Ans:A

6. ________is used to step through each line of code as it executes, including calls to other function?

 A. Step Out
 B. Step Over
 C. Step Into
 D. Run to Cursor
 E. Set Next Statement
Ans:C

5. Which of the following is not a method of Debug class?


A. Assert( )
 B. Flush( )
 C. Open( )
Ans:C

4. ______ protects system resources from unauthorized calls?


A. Role-based security
 B. Code-based security
Ans:B

3. Which of the following is the best to retrieve Read-Only, Forward-only stream of data from database?


A.Data Set
B.Typed Data Set
C.DataReader
Ans:C

2. Any project that compiles to an EXE or DLL files produces an assembly in .NET?


A.True
 B.False
Ans:A

1. Which of the following information is contained in the assembly manifest?

 A. Files
 B. Identity
 C. Security Permissions
 D. All of the above
Ans:D

VB.Net Multiple Choice Questions and Answers for Freshers


1. Which of the following information is contained in the assembly manifest?
2. Any project that compiles to an EXE or DLL files produces an assembly in .NET?
3. Which of the following is the best to retrieve Read-Only, Forward-only stream of data from database?
4. ______ protects system resources from unauthorized calls?
5. Which of the following is not a method of Debug class?
6. ________is used to step through each line of code as it executes, including calls to other function.
7. COMException class is a part of ________?
8. The methods declared with the following modifiers are not accessible out side the current VB.NET project
9. Default properties are always a parameterized property?
10. How do you limit implicit type conversion in VB.NET?
11. Is the Class type in VB.NET a value type?
12. Choose the correct statement about a delegate in VB.NET?
13. Which of the following is not the member of System.Collections?
14. Which of the following control can contain other controls?
15. Which of the following object is used by the DataAdapter to retrieve the data from database?
16. Which of the following control doesn't receive the focus and doesn't have a TabIndex property?
17. Which of the following is not true for Shared members?
18. If no access modifier is specified for a class, it is considered ________
19. System.Collections represents container type for
20. Which of the following namespace provides support for obtaining information and dynamic creation of types at runtime?
21. The smallest unit to which one can associate a version number in .NET is
22. Lower bound value of array in VB.NET
23. Which of the following is not correct about the value types and reference types in VB.NET?
24. Which NameSpace is used to access the metadata in an Assembly?
25. What is the purpose of Invoke Method?
26. In VB.NET, the finalizer must use the Overrides keyword
27. Which one of the following collections receives output from Trace and Debug classes?
28. Using ___________ we can determine if a variable is initialized in VB.NET?
29. _______ can be accessed from all types within the assembly, but not from outside the assembly?
30. How to dereference an object in VB.NET?
30. How to dereference an object in VB.NET?
31. Smart Phone applications and other such devices can be written using:
32. Which class is used to run the EXE application file in VB.NET?
33. Which of the following namespaces is used to access "computer name" and its IP address in VB.NET?
34. How many levels of compilation happens in .NET Framework
35. Most of the underlying integration of .NET is done through XML
36. An Assemblyinfo file in a VB.NET project will have blank as file extesion.
37. Every type supported by CTS is derived from
38. Which of the following Types will have data of fixed size
39. What is the significance of Option Explicit statement when it is set to On
40. Which of the following class does not belong to Collection namespace
41. Methods declared with the following modifier are not accessible outside the class
42. The methods which return the values back to the calling code are called as
43. How do you terminate code execute with in a VB.NET method
44. How do you create a Read only Property in VB.NET
45. The constructors in VB.Net is similar to which event in previous versions of VB
46. Which interface allows to implement the Dispose method to do cleanup work
47. How do you call non shared methods of a class47.How do you call non shared methods of a class
49. Where do you find COMException class
50. Which method of the XMLdocument class takes xml as string while loading
51. Which is the base class for TypedDataset
52. Which is the best to retrieve Read-Only, Forward-only stream of data from database
53. The DataAdapter uses which of the following object to retrieve the data from database
54. Which of the method is used to display the form as modal
55. The tool provided with .Net framework to register assemblies for use by COM is
56. How do you add Web Methods in VB.Net
57. How do you refer the current class in VB.Net
58. How you refer the parent class in VB.Net
59. The serialization of an Object means that it is written out to a stream
60. Which of the following is not a method of Debug class
61. Vb.Net classes can be derived in C#
62. If you know want to migrate your Visual Basic 6 application to VB.NET, what is the first thing you should                    do ?
63. Some bits of a Visual Basic 6 application, like most APIs, can be easily migrated to VB.NET; other parts are not so straightforward. Which of the following will NOT have to be re-architected during a VB 6-to-VB.NET migration ?
64. The Visual Basic Upgrade Wizard will convert all the code in your VB 6 application to VB.NET code for you?
65. This programming language model is used sparingly in VB 6 but is one of the cornerstones of VB.NET. Knowing the ins and outs of it will make an application migration project easier and also prepare you for additional work in VB.NET. What is the model ?
66. What two controls are needed when creating a toolbar ?
67. Can a toolbar display text instead of pictures in the buttons ?
68. The vbc.exe compiler generates:
69. which program will you use to assemble a program written in IL:
70. A ‘for’ loop will run faster in VB.NET or C# ?
71. What’s the difference between a class field property ?
72. Classes from which namespace will have to be used to read or write to a file ?
73. The metadata stored in the assembly is called :
74. My.Application.Log.WriteEntry , by default , writes to the file:
75.To determine the folder in which your application is placed you can use:
76. Select the keyword used to refer the name space in our code in VB.Net
77. How does VB.NET instantiates the .NET object
78. How do you Dereference an Object in VB.NET ?
79. How do you Create Constructors in VB.NET ?
80. How do you enable Strict Type Checking in VB.NET
81. Can you create Windows Services using VB.Net
82. If you know you want to migrate your Visual Basic 6 application to VB.NET, what is the first thing you should do?
83. Some bits of a Visual Basic 6 application, like most APIs, can be easily migrated to VB.NET; other parts are not so straightforward. Which of the following will NOT have to be re-architected during a VB 6-to-VB.NET migration?
84. True or False: The Visual Basic Upgrade Wizard will convert all the code in your VB 6 application to VB.NET code for you.
85. Does the Visual Basic Upgrade Wizard support ASP to ASP.NET migrations?
86. Which of the following is the LEAST compelling reason to migrate an application from Visual Basic 6 to Visual Basic .NET?
87. This programming language model is used sparingly in VB 6 but is one of the cornerstones of VB.NET. Knowing the ins and outs of it will make an application migration project easier and also prepare you for additional work in VB.NET. What is the model?
88. As expected, Visual Basic 2005 comes with lots and lots of improvements over VB 6 and VB 2003. Which of the following is NOT out-of-the-box functionality in Visual Basic 2005?
89. Data query building can sometimes be a bone of contention for VB 6 developers, since it involves SQL or XQuery. Microsoft is introducing a series of changes to the .NET Framework, such as a unified programming model for querying objects, databases and XML, that should make data queries much easier. What is the name for this set of technologies?
90. When Visual Studio 2005 and SQL Server 2005 were introduced to the world, Microsoft decided to revamp its certification process. Once Windows Vista is released, the titles of Microsoft Certified Professional (MCP), Microsoft Certified Application Developer (MCAD), and Microsoft Certified Solution Developer (MCSD) will no longer apply. Which of the following titles is NOT a category in Microsoft's new three-tiered certification framework?
91. You and a friend from college, who works at a company across town, get together for dinner. You explain that you are in the middle of a VB 6-to-VB.NET migration and indicate that it is a bit of a challenge. Your friend says, "You should've just migrated to C#. It's cheaper and easier." Is your friend right?
92. Which of the following are true about Extension methods?
93. which of the following can one use to detect the user's current language?
94. with Which class is the task of mapping a specfic point in time into units such as weeks, months and year accomplished?
95. Which of the follwoing elements can be adjusted when using the processModel element of the Machine.Config File ?
96. Determining the availablity of sufficient memory for an operation can be accompished by
97. which of the following are true about anonymous types?
98. which of the following mechanisma are not suitable for returning a single row froma datatablecontaining a large number of records?
99. Which of the following are true of ADO.NET?
100. which of the following are true of the system.text.StringBuilder class?

Friday 16 December 2011

73. What will be the output of the C#.NET code snippet given below?

namespace IndiabixConsoleApplication
{
    class SampleProgram
    {
        static void Main(string[ ] args)
        {
            int i;
            int res = fun(out i);
            Console.WriteLine(res);
        }
        static int fun (out int i)
        {
            int s = 1;
            i = 7;
            for(int j = 1; j <= i; j++)
            {
                s = s * j;
            }
            return s;
        }
    }
}
A.1
B.7
C.8
D.720
E.5040       
Answer: Option E

71.How many values is a subroutine capable of returning?

A.Depends upon how many params arguments does it use.
B.Any number of values.
C.Depends upon how many ref arguments does it use.
D.0
E.1
Answer: Option D

100. Creating empty structures is allowed in C#.NET?

A.True   
B.False
Answer: Option B

99.The space required for structure variables is allocated on stack?

A.True   
B.False
Answer: Option A

98.Which of the following statements are correct?

1.String is a value type.
2.String literals can contain any character literal including escape sequences.
3.The equality operators are defined to compare the values of string objects as well as references.
4.Attempting to access a character that is outside the bounds of the string results in an IndexOutOfRangeException.
5.The contents of a string object can be changed after the object is created.
A.1, 3
B.3, 5
C.2, 4
D.1, 2, 4
Answer: Option C

97.Which of the following statements are correct about the String Class in C#.NET?

1.Two strings can be concatenated by using an expression of the form s3 = s1 + s2;
2.String is a primitive in C#.NET.
3.A string built using StringBuilder Class is Mutable.
4.A string built using String Class is Immutable.
5.Two strings can be concatenated by using an expression of the form s3 = s1&s2;
A.1, 2, 5
B.2, 4
C.1, 3, 4
D.3, 5
Answer: Option C

96.Which of the following will be the correct output for the C#.NET code snippet given below?

String s1 = "Five Star";
String s2 = "FIVE STAR";
int c;
c = s1.CompareTo(s2);
Console.WriteLine(c);
A.0
B.1
C.2
D.-1
E.-2       
Answer: Option D

95.Which of the following statement is correct about a String in C#.NET?

A.A String is mutable because it can be modified once it has been created.
B.Methods of the String class can be used to modify the string.
C.A number CANNOT be represented in the form of a String.
D.A String has a zero-based index.
E.The System.Array class is used to represent a string.
Answer: Option D

94.Which of the following statements about a String is correct?

A.A String is created on the stack.
B.Whether a String is created on the stack or the heap depends on the length of the String.
C.A String is a primitive.
D.A String can be created by using the statement String s1 = new String;
E.A String is created on the heap.
Answer: Option E

93.Which of the following will be the correct output for the C#.NET code snippet given below?

String s1="Kicit";
Console.Write(s1.IndexOf('c') + " ");
Console.Write(si.Length);
A.3 6
B.2 5
C.3 5
D.2 6
E.3 7
Answer: Option B

92.What will be the output of the C#.NET code snippet given below?

namespace IndiabixConsoleApplication
{
    class SampleProgram
    {
        static void Main(string[ ] args)
        {
            string str= "Hello World!";
            Console.WriteLine( String.Compare(str, "Hello World?" ).GetType() );
        }
    }
}
A.0
B.1
C.String
D.Hello World?
E.System.Int32
Answer: Option E

91.If s1 and s2 are references to two strings, then which of the following is the correct way to compare the two references?

A.s1 is s2
B.s1 = s2
C.s1 == s2
D.strcmp(s1, s2)
E.s1.Equals(s2)
Answer: Option E

90.Which of the following will be the correct output for the C#.NET code snippet given below?

String s1 = "Nagpur";
String s2;
s2 = s1.insert(6, "Mumbai");
Console.WriteLine(s2);
A.NagpuMumbair
B.Nagpur Mumbai
C.Mumbai
D.Nagpur
E.NagpurMumbai
Answer: Option E

89. Which of the following statements will correctly copy the contents of one string into another ?


88.Which of the following will be the correct output for the C#.NET code snippet given below?

String s1 = "ALL MEN ARE CREATED EQUAL";
String s2;
s2 = s1.Substring(12, 3);
Console.WriteLine(s2);
A.ARE
B.CRE
C.CR
D.REA
E.CREATED       
Answer: Option B

87.Which of the following statements are true about the C#.NET code snippet given below?

String s1, s2;
s1 = "Hi";
s2 = "Hi";
1.String objects cannot be created without using new.
2.Only one object will get created.
3.s1 and s2 both will refer to the same object.
4.Two objects will get created, one pointed to by s1 and another pointed to bys2.
5.s1 and s2 are references to the same object.
A.1, 2, 4
B.2, 3, 5
C.3, 4
D.2, 5
Answer: Option B

85.Which of the following is the correct way to implement a read only property Length in aSample class?

A.class Sample
{
    int len;
    public int Length
    {
        get
        {
            return len;
        }
    }
}
B.class Sample
{
    public int Length
    {
        get
        {
            return Length;
        }
    }
}
C.class Sample
{
    int len;
    public int Length
    {
        get
        {
            return len;
        }
        set
        {
            len = value;
        }
    }
}
D.class Sample
{
    int len;
    public int Length
    {
        Readonly get
        {
            return len;
        }
    }
}
Answer: Option A

84.Which of the following statements is correct about properties used in C#.NET?

A.Every property must have a set accessor and a get accessor.
B.Properties cannot be overloaded.
C.Properties of a class are actually methods that work like data members.
D.A property has to be either read only or a write only.
Answer: Option C

83.If Sample class has a Length property with get accessor then which of the following statements will work correctly?

A.Sample m = new Sample();
m.Length = 10;
B.Sample m = new Sample();
m.Length = m.Length + 20;
C.Sample m = new Sample();
int l;
l = m.Length;
D.Sample.Length = 20;
E.Console.WriteLine(Sample.Length);
Answer: Option C

82.If Sample class has a Length property with set accessor then which of the following statements will work correctly?

A.Sample m = new Sample();
int l;
l = m.Length;
B.    Sample m = new Sample();
m.Length = m.Length + 20;
C.    Sample.Length = 20;
D.    Console.WriteLine (Sample.Length);
E.    Sample m = new Sample();
m.Length = 10;
Answer: Option E

81. A property can be declared inside a namespace or a procedure.

A.True   
B.False
Answerca: Option B

80.If Sample class has a Length property with get and set accessors then which of the following statements will work correctly?p

1.Sample.Length = 20;
2.Sample m = new Sample();
3.m.Length = 10;
4.Console.WriteLine(Sample.Length);
5.Sample m = new Sample();
6.int len;
7.len = m.Length;
8.Sample m = new Sample();
9.m.Length = m.Length + 20;
A.1, 3
B.2, 4, 5
C.4 only
D.3, 5
Answer: Option B

79.Which of the following statements are correct?

1.The signature of an indexer consists of the number and types of its formal parameters.
2.Indexers are similar to properties except that their accessors take parameters.
3.Accessors of interface indexers use modifiers.
4.The type of an indexer and the type of its parameters must be at least as accessible as the indexer itself.
5.An interface accessor contains a body.
A.1, 3, 5
B.1, 2, 4
C.3, 5
D.2, 4
Answer: Option B

78.Which of the following statements is correct about properties used in C#.NET?

A.A property can simultaneously be read only or write only.
B.A property can be either read only or write only.
C.A write only property will have only get accessor.
D.A write only property will always return a value.
Answer: Option B

77.A property can be declared inside a class, struct, Interface.

A.True   
B.False
Answer: Option A

76.What will be the output of the C#.NET code snippet given below?

namespace IndiabixConsoleApplication
{
    class SampleProgram
    {
        static void Main(string[ ] args)
        {
            int i = 5;
            int j;
            fun1(ref i);
            fun2(out j);
            Console.WriteLine(i + ", " + j);
        }
        static void funl(ref int x)
        {
            x = x * x;
        }
        static void fun2(out int x)
        {
            x = 6;
            x = x * x;
        }
    }
}
A.5, 6
B.5, 36
C.25, 36
D.25, 0
E.5, 0
Answer: Option C

75.A function can be used in an expression, whereas a subroutine cannot be.

A.True
B.False
Answer: Option A

74.Which of the following statements are correct about subroutines used in C#.NET?

1.If we do not return a value from a subroutine then a value -1 gets returned.
2.Subroutine definitions cannot be nested.
3.Subroutine can be called recursively.
4.To return the control from middle of a subroutine exit subroutine should be used.
5.Subroutine calls can be nested.
A.1, 2, 3
B.2, 3, 5
C.3, 5
D.3, 4
E.None of these
Answer: Option B

73. What will be the output of the C#.NET code snippet given below?

namespace IndiabixConsoleApplication
{
    class SampleProgram
    {
        static void Main(string[ ] args)
        {
            int i;
            int res = fun(out i);
            Console.WriteLine(res);
        }
        static int fun (out int i)
        {
            int s = 1;
            i = 7;
            for(int j = 1; j <= i; j++)
            {
                s = s * j;
            }
            return s;
        }
    }
}
A.1
B.7
C.8
D.720
E.5040       
Answer: Option E

72.Which of the following CANNOT occur multiple number of times in a program?

A.namespace   
B.Entrypoint
C.Class   
D.Function
E.Subroutine       
Answer: Option B

71.How many values is a subroutine capable of returning?

A.Depends upon how many params arguments does it use.
B.Any number of values.
C.Depends upon how many ref arguments does it use.
D.0
E.1
Answer: Option D

70.What will be the output of the C#.NET code snippet given below?

namespace IndiabixConsoleApplication
{
    class SampleProgram
    {
        static void Main(string[ ] args)
        {
            object[] o = new object[] {"1", 4.0, "India", 'B'};
            fun (o);
        }
        static void fun (params object[] obj)
        {
            for (int i = 0; i < obj.Length-1; i++)
            Console.Write(obj[i] + " ");
        }
    }
}
A.1 4.0 India B
B.1 4.0 India
C.1 4 India
D.1 India B
Answer: Option C

69.How many values is a function capable of returning?

A.1
B.0
C.Depends upon how many params arguments does it use.
D.Any number of values.
E.Depends upon how many ref arguments does it use.
Answer: Option A

68.Which of the following statements are correct about functions used in C#.NET?

1.Function definitions cannot be nested.
2.Functions can be called recursively.
3.If we do not return a value from a function then a value -1 gets returned.
4.To return the control from middle of a function exit function should be used.
5.Function calls can be nested.
A.1, 2, 5
B.2, 3, 5
C.2, 3
D.4, 5
E.None of these
Answer: Option A

67.Which of the following statements are correct?

1.C# allows a function to have arguments with default values.
2.C# allows a function to have variable number of arguments.
3.Omitting the return value type in method definition results into an exception.
4.Redefining a method parameter in the method's body causes an exception.
5.params is used to specify the syntax for a function with variable number of arguments.
A.1, 3, 5
B.3, 4, 5
C.2, 5
D.4, 5
E.None of these
Answer: Option C

66.What will be the output of the C#.NET code snippet given below?

namespace IndiabixConsoleApplication
{
    class SampleProgram
    {
        static void Main(string[ ] args)
        {
            int i = 10;
            double d = 34.340;
            fun(i);
            fun(d);
        }
        static void fun(double d)
        {
            Console.WriteLine(d + " ");
        }
    }
}
A.10.000000 34.340000
B.10 34
C.10 34.340
D.10 34.34
Answer: Option D

65.Which of the following will be the correct output for the C#.NET program given below?

namespace IndiabixConsoleApplication
{
    class SampleProgram
    {
        static void Main(string[] args)
        {
            int a = 5;
            int s = 0, c = 0;
            Proc(a, ref s, ref c);
            Console.WriteLine(s + " " + c);
        }
        static void Proc(int x, ref int ss, ref int cc)
        {
            ss = x * x;
            cc = x * x * x;
        }
    }
}
A.0 0
B.25 25
C.125 125
D.25 125
E.None of the above
Answer: Option D

64.Which of the following statements are correct about functions and subroutines used in C#.NET?

1.A function cannot be called from a subroutine.
2.The ref keyword causes arguments to be passed by reference.
3.While using ref keyword any changes made to the parameter in the method will be reflected in that variable when control
passes back to the calling method.
4.A subroutine cannot be called from a function.
5.Functions and subroutines can be called recursively.
A.1, 2, 4
B.2, 3, 5
C.3, 5
D.4, 5
E.None of these
Answer: Option B

63.A function returns a value, whereas a subroutine cannot return a value.

A.True   
B.False
Answer: Option A

62. Which of the following statements are correct?

1.An argument passed to a ref parameter need not be initialized first.
2.Variables passed as out arguments need to be initialized prior to being passed.
3.Argument that uses params keyword must be the last argument of variable argument list of a method.
4.Pass by reference eliminates the overhead of copying large data items.
5.To use a ref parameter only the calling method must explicitly use the refkeyword.
A.1, 2
B.2, 3
C.3, 4
D.4, 5
E.None of these
Answer: Option C

61. What will be the output of the C#.NET code snippet given below?

namespace IndiabixConsoleApplication
{
    class SampleProgram
    {
        static void Main(string[] args)
        {
            int[]arr = newint[]{ 1, 2, 3, 4, 5 };
            fun(ref arr);
        }
        static void fun(ref int[] a)
        {
            for (int i = 0; i < a.Length; i++)
            {
                a[i] = a[i] * 5;
                Console.Write(a[ i ] + " ");
            }
        }
    }
}
A.1 2 3 4 5
B.6 7 8 9 10
C.5 10 15 20 25
D.5 25 125 625 3125
E.6 12 18 24 30
Answer: Option C

60.Which of the following will be the correct output for the C#.NET program given below?

namespace IndiabixConsoleApplication
{
    class SampleProgram
    {
        static void Main(string[] args)
        {
            int num = 1;
            funcv(num);
            Console.Write(num + ", ");
            funcr(ref num);
            Console.Write(num + ", ");
        }
        static void funcv(int num)
        {
            num = num + 10; Console.Write(num + ", ");
        }
        static void funcr (ref int num)
        {
            num = num + 10; Console.Write(num + ", ");
        }
    }
}
A.1, 1, 1, 1,
B.11, 1, 11, 11,
C.11, 11, 11, 11,
D.11, 11, 21, 11,
E.11, 11, 21, 21,
Answer: Option B

59.Which of the following statements is correct about constructors in C#.NET?

A.A constructor cannot be declared as private.
B.A constructor cannot be overloaded.
C.A constructor can be a static constructor.
D.A constructor cannot access static data.
E.this reference is never passed to a constructor.
Answer: Option C

58.What will be the output of the C#.NET code snippet given below?

namespace IndiabixConsoleApplication
{
    class Sample
    {
        static Sample()
        {
            Console.WriteLine("Sample class");
        }
        public static void Bix1()
        {
            Console.WriteLine("Bix1 method");
        }
    }
    class MyProgram
    {
        static void Main(string[ ] args)
        {
            Sample.Bix1();
        }
    }
}
A.Sample class Bix1 method
B.Bix1 method
C.Sample class
D.Bix1 method Sample class
E.Sample class Sample class
Answer: Option A

57.Which of the following statements are correct about static functions?

A.Static functions are invoked using objects of a class.
B.Static functions can access static data as well as instance data.
C.Static functions are outside the class scope.
D.Static functions are invoked using class.
Answer: Option D

56.Is it possible for you to prevent an object from being created by using zero argument constructor?

A.Yes   
B.No
Answer: Option A

55.Which of the following statements is correct?

A.There is one garbage collector per program running in memory.
B.There is one common garbage collector for all programs.
C.An object is destroyed by the garbage collector when only one reference refers to it.
D.We have to specifically run the garbage collector after executing Visual Studio.NET.
Answer: Option B

54.Which of the following statements are correct about the C#.NET code snippet given below?

class Sample
{
    static int i;
    int j;
    public void proc1()
    {
        i = 11;
        j = 22;
    }
    public static void proc2()
    {
        i = 1;
        j = 2;
    }
    static Sample()
    {
        i = 0;
        j = 0;
    }
}
A.i cannot be initialized in proc1().
B.proc1() can initialize i as well as j.
C.j can be initialized in proc2().
D.The constructor can never be declared as static.
E.proc2() can initialize i as well as j.
Answer: Option B

53.Is it possible to invoke Garbage Collector explicitly?

A.Yes
B.No
Answer: Option A

52.How many times can a constructor be called during lifetime of the object?

A.As many times as we call it.
B.Only once.
C.Depends upon a Project Setting made in Visual Studio.NET.
D.Any number of times before the object gets garbage collected.
E.Any number of times before the object is deleted.
Answer: Option B

51.Which of the following statements are correct about constructors in C#.NET?

1.Constructors cannot be overloaded.
2.Constructors always have the name same as the name of the class.
3.Constructors are never called explicitly.
4.Constructors never return any value.
5.Constructors allocate space for the object in memory.
A.1, 3, 5
B.2, 3, 4
C.3, 5
D.4, 5
E.None of these
Answer: Option B

50.Can static procedures access instance data?

A.Yes   
B.No
Answer: Option B

49.In which of the following should the methods of a class differ if they are to be treated as overloaded methods?

1.Type of arguments
2.Return type of methods
3.Number of arguments
4.Names of methods
5.Order of arguments
A.2, 4
B.3, 5
C.1, 3, 5
D.3, 4, 5
Answer: Option C

48.Which of the following statements is correct about constructors?

A.If we provide a one-argument constructor then the compiler still provides a zero-argument constructor.
B.Overloaded constructors have the same name as the class name.
C.Overloaded constructors cannot use optional arguments.
D.If we do not provide a constructor, then the compiler provides a zero-argument constructor.
E.Static constructors can use optional arguments.
Answer: Option D

47.Which of the following statements are correct about static functions?

1.Static functions can access only static data.
2.Static functions cannot call instance functions.
3.It is necessary to initialize static data.
4.Instance functions can call static functions and access static data.
5.this reference is passed to static functions.
A.1, 2, 4
B.2, 3, 5
C.3, 4
D.4, 5
E.None of these
Answer: Option A

46. Which of the following ways to create an object of the Sample class given below will work correctly?

class Sample
{
    int i;
    Single j;
    double k;
    public Sample (int ii, Single jj, double kk)
    {
        i = ii;
        j = jj;
        k = kk;
    }
}
A.Sample s1 = new Sample();
B.Sample s1 = new Sample(10);
C.Sample s2 = new Sample(10, 1.2f);
D.Sample s3 = new Sample(10, 1.2f, 2.4);
E.Sample s1 = new Sample(, , 2.5);
Answer: Option D

45.Which of the following statements is correct about the C#.NET code snippet given below?

namespace IndiabixConsoleApplication
{
    class Sample
    {
        public int func()
        {
            return 1;
        }
        public Single func()
        {
            return 2.4f ;
        }
    }
    class Program
    {
        static void Main(string[ ] args)
        {
            Sample s1 = new Sample();
            int i;
            i = s1.func();
            Single j;
            j = s1.func();
        }
    }
}
A.func() is a valid overloaded function.
B.Overloading works only in case of subroutines and not in case of functions.
C.func() cannot be considered overloaded because: return value cannot be used to distinguish between two overloaded functions.
D.The call to i = s1.func() will assign 1 to i.
E.The call j = s1.func() will assign 2.4 to j.
Answer: Option C

44.Which of the following statements is correct?

A.A constructor can be used to set default values and limit instantiation.
B.C# provides a copy constructor.
C.Destructors are used with classes as well as structures.
D.A class can have more than one destructor.
Answer: Option A

43.Which of the following statements are correct about the Collection Classes available in Framework Class Library?

A.Elements of a collection cannot be transmitted over a network.
B.Elements stored in a collection can be retrieved but cannot be modified.
C.It is not easy to adopt the existing Collection classes for newtype of objects.
D.Elements stored in a collection can be modified only if allelements are of similar types.
E.They use efficient algorithms to manage the collection, thereby improving the performance of the program.
Answer: Option E

42.Which of the following is the correct way to find out the number of elements currently present in an ArrayList Collection called arr?

A.arr.Count
B.arr.GrowSize
C.arr.MaxIndex
D.arr.Capacity
E.arr.UpperBound
Answer: Option A

41.Which of the following is an ordered collection class?

1.Map
2.Stack
3.Queue
4.BitArray
5.HashTable
A.1 only
B.2 and 3 only
C.4 and 5 only
D.All of the above
E.None of the above
Answer: Option B

40.Which of the following is NOT an interface declared in System.Collectionsnamespace?

A.IComparer
B.Enumerable
C.Enumerator
D.IDictionaryComparer
E.IDictionaryEnumerator
Answer: Option D

39.Which of the following statements are correct about the Stack collection?

1.It can be used for evaluation of expressions.
2.All elements in the Stack collection can be accessed using an enumerator.
3.It is used to maintain a FIFO list.
4.All elements stored in a Stack collection must be of similar type.
5.Top-most element of the Stack collection can be accessed using the Peek()method.
A.1 and 2 only
B.3 and 4 only
C.1, 2 and 5 only
D.All of the above
E.None of the above
Answer: Option C

38.Which of the following statements are correct about the C#.NET code snippet given below?

Stack st = new Stack();
st.Push("hello");
st.Push(8.2);
st.Push(5);
st.Push('b');
st.Push(true);
A.Dissimilar elements like "hello", 8.2, 5 cannot be stored in the sameStack collection.
B.Boolean values can never be stored in Stack collection.
C.In the fourth call to Push(), we should write "b" in place of 'b'.
D.To store dissimilar elements in a Stack collection, a method PushAnyType()should be used in place of Push().
E.This is a perfectly workable code.
Answer: Option E

37. In a HashTable Key cannot be null, but Value can be?

A.True   
B.False
Answer: Option A

36.In which of the following collections is the Input/Output based on a key?

1.Map
2.Stack
3.BitArray
4.HashTable
5.SortedList
A.1 and 2 only
B.2 and 3 only
C.1, 2 and 3 only
D.4 and 5 only
E.All of the above
Answer: Option D

35. In which of the following collections is the Input/Output index-based?

1.Stack
2.Queue
3.BitArray
4.ArrayList
5.HashTable
A.1 and 2 only
B.3 and 4 only
C.5 only
D.1, 2 and 5 only
E.All of the above
Answer: Option B

34.How many enumerators will exist if four threads are simultaneously working on anArrayList object?

A.1
B.3
C.2
D.4
Answer: Option D

33.Which of the following statements are correct about an ArrayList collection that implements the IEnumerable interface?

1.The ArrayList class contains an inner class that implements theIEnumerator interface.
2.An ArrayList Collection cannot be accessed simultaneously by different threads.
3.The inner class of ArrayList can access ArrayList class's members.
4.To access members of ArrayList from the inner class, it is necessary to pass ArrayList class's reference to it.
5.Enumerator's of ArrayList Collection can manipulate the array.
A.1 and 2 only
B.1 and 3 and 4 only
C.2 and 5 only
D.All of the above
E.None of the above
Answer: Option B

32.What will be the output of the C#.NET code snippet given below?

namespace IndiabixConsoleApplication
{
    class SampleProgram
    {
        static void Main(string[ ] args)
        {
            int i, j;
            int[ , ] arr = new int[ 2, 2 ];
            for(i = 0; i < 2; ++i)
            {
                for(j = 0; j < 2; ++j)
                {
                    arr[i, j] = i * 17 + i * 17;
                    Console.Write(arr[ i, j ] + " ");
                }
            }
        }
    }
}
A.0 0 34 34
B.0 0 17 17
C.0 0 0 0
D.17 17 0 0
E.34 34 0 0
Answer: Option A

31.Which of the following is the correct way to obtain the number of elements present in the array given below?

int[] intMyArr = {25, 30, 45, 15, 60};
1.intMyArr.GetMax;
2.intMyArr.Highest(0);
3.intMyArr.GetUpperBound(0);
4.intMyArr.Length;
5.intMyArr.GetMaxElements(0);
A.1, 2
B.3, 4
C.3, 5
D.1, 5
E.4, 5
Answer: Option B

30.Which of the following is the correct output of the C#.NET code snippet given below?

int[][] a = new int[2][];
    a[0] = n ew int[4]{6, 1, 4, 3};
    a[1] = new int[3]{9, 2, 7};
    Console.WriteLine(a[1].GetUpperBound(0));
A.3   
B.4
C.7
D.9
E.2       
Answer: Option E

29.Which of the following is the correct way to define and initialise an array of 4 integers?

1.int[] a = {25, 30, 40, 5};
2.int[] a;
3.a = new int[3];
4.a[0] = 25;
5.a[1] = 30;
6.a[2] = 40;
7.a[3] = 5;
8.int[] a;
9.a = new int{25, 30, 40, 5};
10.int[] a;
11.a = new int[4]{25, 30, 40, 5};
12.int[] a;
13.a = new int[4];
14.a[0] = 25;
15.a[1] = 30;
16.a[2] = 40;
17.a[3] = 5;
A.1, 2
B.3, 4
C.1, 4, 5
D.2, 4, 5
E.5, 5
Answer: Option C

28.Which of the following statements is correct about the C#.NET code snippet given below?

int[] intMyArr = {11, 3, 5, 9, 4};
A.intMyArr is a reference to an object of System.Array Class.
B.intMyArr is a reference to an object of a class that the compiler derives fromSystem.Array Class.
C.intMyArr is a reference to an array of integers.
D.intMyArr is a reference to an object created on the stack.
E.intMyArr is a reference to the array created on the stack.
Answer: Option B

27.Which of the following statements is correct about the array declaration given below?

int[][][] intMyArr = new int[2][][];
A.intMyArr refers to a 2-D jagged array containing 2 rows.
B.intMyArr refers to a 2-D jagged array containing 3 rows.
C.intMyArr refers to a 3-D jagged array containing 2 2-D jagged arrays.
D.intMyArr refers to a 3-D jagged array containing three 2-D jagged arrays.
E.intMyArr refers to a 3-D jagged array containing 2 2-D rectangular arrays.
Answer: Option C

26.Which of the following are the correct ways to define an array of 2 rows and 3 columns?

1.int[ , ] a;
2.a = new int[2, 3]{{7, 1, 3},{2, 9, 6}};
3.int[ , ] a;
4.a = new int[2, 3]{};
5.int[ , ] a = {{7, 1, 3}, {2, 9,6 }};
6.int[ , ] a;
7.a = new int[1, 2];
8.int[ , ] a;
9.a = new int[1, 2]{{7, 1, 3}, {2, 9, 6}};
A.1, 2 , 3
B.1, 3
C.2, 3
D.2, 4, 5
E.4, 5
Answer: Option B

25.Which of the following statements are correct about the C#.NET code snippet given below?

int[][]intMyArr = new int[2][];
   intMyArr[0] = new int[4]{6, 1, 4, 3};
   intMyArr[1] = new int[3]{9, 2, 7};
A.intMyArr is a reference to a 2-D jagged array.
B.The two rows of the jagged array intMyArr are stored in adjacent memory locations.
C.intMyArr[0] refers to the zeroth 1-D array and intMyArr[1] refers to the first 1-D array.
D.intMyArr refers to intMyArr[0] and intMyArr[1].
E.intMyArr refers to intMyArr[1] and intMyArr[2].
Answer: Option C

24.Which of the following statements are correct about arrays used in C#.NET?

1.Arrays can be rectangular or jagged.
2.Rectangular arrays have similar rows stored in adjacent memory locations.
3.Jagged arrays do not have an access to the methods of System.ArrayClass.
4.Rectangular arrays do not have an access to the methods of System.ArrayClass.
5.Jagged arrays have dissimilar rows stored in non-adjacent memory locations.
A.1, 2
B.1, 3, 5
C.3, 4
D.1, 2, 5
E.4, 5
Answer: Option D

23.Creating empty structures is allowed in C#.NET?

A.True   
B.False
Answer: Option B

21.How will you complete the foreach loop in the C#.NET code snippet given below such that it correctly prints all elements of the array a?

int[][]a = new int[2][];
    a[0] = new int[4]{6, 1 ,4, 3};
    a[1] = new int[3]{9, 2, 7};
    foreach (int[ ] i in a)
    {
        /* Add loop here */
        Console.Write(j + " ");
        Console.WriteLine();
    }
A.foreach (int j = 1; j < a(0).GetUpperBound; j++)
B.foreach (int j = 1; j < a.GetUpperBound (0); j++)
C.foreach (int j in a.Length)
D.foreach (int j in i)
E.foreach (int j in a.Length -1)
Answer: Option D

22.Which of the following is the correct output of the C#.NET code snippet given below?

int[ , , ] a = new int[ 3, 2, 3 ];
Console.WriteLine(a.Length);
A.20   
B.4
C.18
D.10
E.5       
Answer: Option C

Tuesday 13 December 2011

20. If a is an array of 5 integers then which of the following is the correct way to increase its size to 10 elements?20.If a is an array of 5 integers then which of the following is the correct way to increase its size to 10 elements?

A. int[] a = new int[5];
    int[] a = new int[10];
B. int[] a = int[5];
    int[] a = int[10];
C. int[] a = new int[5];
    a.Length = 10 ;
D. int[] a = new int[5];
    a = new int[10];
E. int[] a = new int[5];
   a.GetUpperBound(10);
Answer: Option D

19. Which one of the following statements is correct?

A. Array elements can be of integer type only.
B. The rank of an Array is the total number of elements it can contain.
C. The length of an Array is the number of dimensions in the Array.
D. The default value of numeric array elements is zero.
E. The Array elements are guaranteed to be sorted.
Answer: Option D

18.Which of the following statements are correct about the C#.NET code snippet given below?

 int[] a = {11, 3, 5, 9, 4};
1.The array elements are created on the stack.
2.Refernce a is created on the stack.
3.The array elements are created on the heap.
4.On declaring the array a new array class is created which is derived fromSystem.Array Class.
5.Whether the array elements are stored in the stack or heap depends upon the size of the array.
A. 1, 2
B. 2, 3, 4
C. 2, 3, 5
D. 4, 5
E. None of these
Answer: Option B

17. Which of the following statements are correct about the C#.NET code snippet given below?

int[ , ] intMyArr = {{7, 1, 3}, {2, 9, 6}};
1.intMyArr represents rectangular array of 2 rows and 3 columns.
2.intMyArr.GetUpperBound(1) will yield 2.
3.intMyArr.Length will yield 24.
4.intMyArr represents 1-D array of 5 integers.
5.intMyArr.GetUpperBound(0) will yield 2.
A. 1, 2
B. 2, 3
C. 2, 5
D. 1, 4
E.  3, 4
Answer: Option A

16. Which of the following statements is correct about classes and objects in C#.NET?

A. Class is a value type.
B. Since objects are typically big in size, they are created on the stack.
C. Objects of smaller size are created on the heap.
D. Smaller objects that get created on the stack can be given names.
E. Objects are always nameless.
Answer: Option E

15. Which of the following statements are correct about the C#.NET code snippet given below?

namespace IndiabixConsoleApplication
{
    class Sample
    {
        int i, j;
        public void SetData(int ii, int jj)
        {
            this.i = ii;
            this.j = jj
        }
    }
    class MyProgram
    {
        static void Main(string[ ] args)
        {
            Sample s1 = new Sample();
            s1.SetData(10, 2);
            Sample s2 = new Sample();
            s2.SetData(5, 10);
        }
    }
}
A.The code will not compile since we cannot explicitly use this.
B.Using this in this program is necessary to properly set the values in the object.
C.The call to SetData() is wrong since we have not explicitly passed the thisreference to it.
D.The definition of SetData() is wrong since we have not explicitly collected the this reference.
E.Contents of this will be different during each call to SetData().
Answer: Option E