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

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

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

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. Which of the following namespaces is used to access "computer name" and its IP address in VB.NET?
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?
31. How many levels of compilation happens in .NET Framework
32. Most of the underlying integration of .NET is done through XML
33. An Assemblyinfo file in a VB.NET project will have blank as file extension.
34. Every type supported by CTS is derived from
35. Which of the following Types will have data of fixed size
36. What is the significance of Option Explicit statement when it is set to On
37. Which of the following class does not belong to Collection namespace
38. Methods declared with the following modifier are not accessible outside the class
39. The methods which return the values back to the calling code are called as
40. How do you terminate code execute with in a VB.NET method
41. How do you create a Read only Property in VB.NET
42. The constructors in VB.Net is similar to which event in previous versions of VB
43. Which interface allows to implement the Dispose method to do cleanup work
44. How do you call non shared methods of a class
45. How do we implement private interfaces
46. Where do you find COMException class
47. Which method of the XMLdocument class takes xml as string while loading
48. Which is the base class for TypedDataset
49. Which is the best to retrieve Read-Only, Forward-only stream of data from database
50. The DataAdapter uses which of the following object to retrieve the data from database
51. Which of the method is used to display the form as modal
52. The tool provided with .Net framework to register assemblies for use by COM is
53. How do you add Web Methods in VB.Net
54. How do you refer the current class in VB.Net
55. How you refer the parent class in VB.Net
56. The serialization of an Object means that it is written out to a stream
57. Which of the following is not a method of Debug class
58. Vb.Net classes can be derived in C#
59. Smart Phone applications and other such devices can be written using:
60. Which class is used to run the EXE application file in VB.NET?
61. If you know want to migrate your Visual Basic 6 application to VB.NET, what is the first thing you should do ?
62. 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 ?
63. The Visual Basic Upgrade Wizard will convert all the code in your VB 6 application to VB.NET code for you.
64. 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 ? 
65. What two controls are needed when creating a toolbar ?
66. Can a toolbar display text instead of pictures in the buttons ?
67. The vbc.exe compiler generates:
68. Which program will you use to assemble a program written in IL:
69. A ‘for’ loop will run faster in VB.NET or C# ?
70. What’s the difference between a class field property ?
71. Classes from which namespace will have to be used to read or write to a file ?
72. The metadata stored in the assembly is called :
73. My.Application.Log.WriteEntry , by default , writes to the file:
74. To determine the folder in which your application is placed you can use:
75. Select the keyword used to refer the name space in our code in VB.Net
76. How does VB.NET instantiates the .NET object
77. How do you Dereference an Object in VB.NET ?
78. How do you Create Constructors in VB.NET ?
79. How do you enable Strict Type Checking in VB.NET
80. Can you create Windows Services using VB.Net

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