Вы находитесь на странице: 1из 13

[2]

Which of the following statement is not correct? Choice a The CLR of the .NET Framework runs on operating system. Choice b The unmanaged applications run under the control of CLR and use the .NET Base Class Library and custom class library. Choice c On the server-side Internet Information Services run on top of OS. Choice d ASP.NET runtime internally uses CLR and adds its own features specific to processing HTTP requests. Which of the following does not belong to a .NET Framework class library? Choice a Classes Choice b Structs Choice c Metadata Choice d Interfaces Which of the following is not a repetition structure? Choice a While End While Choice b Do Loop Choice c If Then Else Choice d For Each Next Consider following code snippet:

[3]

[4]

[7]

Module Module1 Class sample Shared obj As sample Private Sub New( ) End Sub Shared Function create( ) As sample If obj Is Nothing Then obj = New sample End If Return obj End Function End Class Sub Main ( ) Dim s As sample s = New sample s.create ( ) End Sub End Module Which of the following statement is correct about the code? Choice a The code runs successfully. Choice b Error: Shared cannot be used with data members. Choice c Error: Constructors cannot be declared Private . Choice d Error: Private Sub New( )' is not accessible in this context because it is 'Private'.

Consider following code snippet: Module Module1 Class sample Dim i As Integer Shared Sub New( ) i = 10 End Sub Sub showdata( ) Console.WriteLine ( i ) End Sub End Class Sub Main( ) Dim s As New sample s.showdata( ) End Sub End Module Which of the following statement is correct about the above code? Choice a The code runs successfully. Choice b Error: 'Shared cannot be used with constructors' Choice c Error: 'Cannot refer to an instance member of a class from within a shared method or shared member initializer without an explicit instance of the class' Choice d Error: 'Name i is not declared' [q]Class test Dim i As integer Public Sub setadata ( i As Integer ) 'add statement to initialize i End Sub End Class Which of the following statement is correct that can be added to the setdata( ) method to initialize data member i of class test? Choice a Me.i = i Choice b Me.i = i ; Choice c i=i Choice d i=i;

[10]

An object is similar to Choice a A data type Choice b A variable Choice c A method Choice d An object

[11] The keyword used to specify that a property or method overrides a member inherited from a base class is Choice a Overloads Choice b Overrides Choice c Overloadable Choice d Overridable [12] Consider following code snippet:

Module Module1 Class Base Private Sub fun1( ) Console.WriteLine ( "fun1 of Base..." ) End Sub Protected Sub fun2( ) fun1( ) Console.WriteLine ( "fun2 of Base..." ) End Sub End Class Class Der : Inherits Base Overloads Sub fun1( ) Console.WriteLine ( "fun1 of Der..." ) End Sub Overloads Sub fun2( ) MyBase.fun2( ) End Sub End Class Sub Main( ) Dim d As New Der d.fun2( ) End Sub End Module What would be the output of the above code? Choice a fun2 of Base... fun2 of Base... Choice b fun1 of Base... fun2 of Base... Choice c fun1 of Der... fun2 of Base... Choice d fun1 Der...

[13] The multidimensional array in which the number of elements in each row is same and which occupy adjacent memory location is Choice a Jagged array Choice b Rectangular array Choice c Circular array Choice d Both 1 and 2 [14] A 3D rectangular array contains Choice a Three 3D arrays Choice b Two 3D arrays Choice c Three 2D arrays Choice d Three 1D arrays Which of the following statement is correct about String? Choice a The value of String can be modified once it has been created. Choice b String is mutable. Choice c String is a structure and treated as a primitive. Choice d String is a class and treated as a primitive. Which of the following class is provided if an unassigned reference is used? Choice a FormatException Choice b OutOfMemoryException Choice c NullReferenceException Choice d ArithmeticException The errors which occur at the time of execution of the program are known as Choice a Exceptions Choice b Syntax errors Choice c Linker errors Choice d Grammatical errors The class that implement the ICollection interface is Choice a Stack Choice b Queue Choice c Array Choice d Both 1 and 2 Consider following code snippet: Module Module1 Sub Main( ) Dim x As Integer = 0 Try Dim y As Integer = 100 / x Catch e As ArithmeticException Console.WriteLine ( "ArithmeticException Handler: {0}", e.ToString( ) ) Catch e As Exception Console.WriteLine ( "Generic Exception Handler: {0}", e.ToString( ) ) End Try

[15]

[17]

[18]

[19]

20]

End Sub End Module What would be the output of the above code? Choice a Choice b Choice c ArithmeticException Handler: System.OverflowException: Arithmetic operation resulted in an overflow. Generic Exception Handler: System.OverflowException: Arithmetic operation resulted in an overflow. ArithmeticException Handler: System.OverflowException: Arithmetic operation resulted in an overflow. Generic Exception Handler: System.OverflowException: Arithmetic operation resulted in an overflow. No catch blocks will be executed.

Choice d [21]

Consider following code snippet: Imports System.Drawing.Drawing2D Sub Form1_Paint ( s As Object, e As PaintEventArgs ) Handles MyBase.Paint Dim g As Graphics = e.Graphics 'Add code here End Sub

Which of the following code is correct that draws a line of thickness 5 in red color? Choice a g.DrawLine ( mypen, 20, 30, 200, 60 ) Choice b Dim mypen As New Pen ( Color.Red, 5 ) g.DrawLine ( mypen, 20, 30, 200, 60 ) Choice c Dim mypen As New Pen ( Red, 5 ) g.DrawLine ( mypen, 20, 30, 200, 60 ) Choice d Dim mypen As New Pen ( Color.Red, Thickness.5 ) g.DrawLine ( mypen, 20, 30, 200, 60 ) [22] Which of the following event is raised when the mouse cursor is moved which in the area of the control? Choice a MouseEnter(Occurs when the mouse pointer enters the control.) Choice b MouseHover(Occurs when the mouse pointer rests on the control.) Choice c MouseMove(Occurs when the mouse pointer is moved over the control.) Choice d MouseLeave(Occurs when the mouse pointer leaves the control.) [23] Which of the following statement is incorrect? Choice a Each control that can generate events has an associated delegate that defines the signature for that control's event handlers. Choice b Event delegates are single cast, containing a reference to a single method. Choice c In the event handling model delegates act as intermediaries between objects and generate events and methods that handle those events. Choice d Event handlers are methods that process events and perform tasks.

[25]

Which of the following statement is not correct about ComboBox? Choice a The ComboBox control combines Label features with a drop-down list. Choice b A drop-down list is a GUI component that contains a list from which values can be chosen. Choice c By default, the user can enter text into the text box or click the down arrow to display a list of predefined items. Choice d If the list contains more elements that can be displayed in the drop-down list, a scrollbar appears.

[26] Which of the following property sets the position of a menu item when its parent menu is merged with another menu? Choice a MergeMenu Choice b MergeOrder Choice c MergeType Choice d MergeItem [27] Which of the following statement is TRUE? Choice a In single tier architechture the databases were shared amongst different users. Choice b In single tier architechture the databases were not shared amongst different users. Choice c In single tier architechture the database had to be installed on only one machine, i.e the server and no need to install it on client machines. Choice d In single tier architechture the binary file could be shared. Which of the following scenario belongs to Three tier Architechture? Choice a The presentation layer, the business logic layer and the data layer exist on the same machine. Choice b The presentation layer is an application that interacts with the business logic available in component or dll,and the database is stored on the same machine. Choice c The presentation layer, The business logic layer and the database are all stored on different machines. Choice d All the above.

[28]

[29]

Which of the following statement is TRUE? Choice a The SetDataBinding method of the Datagrid class binds the specified dataadapter with the datagrid. Choice b The SetDataBinding method of the Datagrid class binds the specified dataset with the datagrid. Choice c The SetDataBinding method of the Datagrid class binds the specified database with the datagrid. Choice d None of the above.

[30] Consider the following scenario: Suppose we are using SQL server database named books. There is a table named bookinfo in which the third field is of type Image, we want to display this binary data stored in the database in a picture box named "img". Which of the following statement is correct? Choice a We cannot display this image directly by reading it from the database.

Choice b Choice c Choice d

We need to use Byte array and MemoryStream. We Cannot display this image directly by reading it from the database. We need to use Byte array. We cannot display this image directly by reading it from the database. We need to use MemoryStream. We cannot display an image that is stored in the database.

__________________________________________________________
[26] Which of the following code is correct that adds MenuItems to the MainMenu?

Choice a Public Sub New ( ) MyBase.New ( ) InitializeComponent ( ) MainMenu1.MenuItems ( "Open" ) MainMenu1.MenuItems ( "Save" ) MainMenu1.MenuItems( "Exit" ) End Sub Choice b Public Sub New ( ) MyBase.New ( ) InitializeComponent ( ) MainMenu1.Add ( "Open" ) MainMenu1.Add ( "Save" ) MainMenu1.Add ( "Exit" ) End Sub Choice c Public Sub New ( ) MyBase.New ( ) InitializeComponent ( ) MainMenu1.MenuItems.Add ( "Open" ) MainMenu1.MenuItems.Add ( "Save" ) MainMenu1.MenuItems.Add ( "Exit" ) End Sub Choice d Public Sub New ( ) MyBase.New ( ) InitializeComponent ( ) MenuItems.Add ( "Open" ) MenuItems.Add ( "Save" ) MenuItems.Add ( "Exit" ) End Sub

10]

Consider following code snippet: Module Module1 Class sample Dim i As Integer Dim j As Single Sub New ( Optional ByVal ii As Integer = 0, Optional ByVal jj As Single = 0.0 ) i = ii j = jj End Sub End Class Sub Main( ) Dim s As New sample ( , 2.5 ) End Sub End Module

Which of the following statement is correct about the constructor in the above code? Choice a Choice b Choice c Choice d jj As Single ) '. The constructor is a default-argument constructor. Error: 'Keyword Optional is not valid as an identifier' Error: 'Leading arguments cannot be default' Error: 'Argument not specified for parameter 'ii' and 'jj' of 'Public Sub New ( ii As Integer,

[9] A class is similar to Choice a An object Choice b A method Choice c A data type Choice d A variable [8] Which of the following statement is not correct? Choice a A reference is always created on the stack whereas the actual object is there on the heap. Choice b For data types like Integer, Single the variables are always created on the stack. Choice c The objects on heap are always created in adjacent memory locations. Choice d A refernce stores an address of an object. 7] Consider following code snippet: Class car Dim carno As Integer Dim year As Integer 'methods to manipulate data End Class Which of the following statement is correct that restricts us from changing value of year? Choice a Public ReadOnly year As Integer

Choice b Choice c Choice d [6]

Public Shared year As Integer Public Static year As Integer None of the above

Consider following code snippet: Module Module1 Sub Main( ) dim true as Boolean = False Console.WriteLine( true ) End Sub End Module Which of the following statement is correct about the above code? Choice a Error: 'Name true is not declared' Choice b Error: 'Keyword is not valid as an identifier' Choice c Error: 'Identifier is not valid as a keyword' Choice d The code runs successfully. [30] Consider the following scenario: Suppose we are using SQL database named books, containing a table named bookinfo. If we want to store images in binary form, which of the following datatype would be correct to use? Choice a Choice b Choice c Choice d Binary Image Picture None of the above.

[5] The default value for a Boolean data type is Choice a True Choice b False Choice c 1 Choice d None of the above 29] Consider the following scenario: Suppose we have a button by name "Browse" on a form, and upon clicking the button we want that only Image files should get displayed in a dialog window. Choice a Dim ofd as New OpenFileDialog( ) ofd.filter = "Image files | *.jpg" Choice b Dim ofd as New OpenFileDialog( ) ofd.filter = "Image files | *.*" Choice c Dim ofd as New OpenFileDialog( ) ofd.filter = "Image files / *.*" Choice d 28] None of the above.

Consider the following code snippet:

Imports System.Data.SqlClient Module Module1 Sub Main( ) Dim constr As String = " server = < computer name >; database = bank; uid = sa; pwd = thanks" Dim cmdstr As String = ______________________ Dim con As New SqlConnection ( constr ) Dim com As New SqlCommand ( cmdstr, con ) con.Open( ) Dim r As SqlDataReader = com.ExecuteReader While r.Read Console.WriteLine ( r ( 0 ) & " " & r ( 1 ) & " " & r ( 2 ) ) End While End Sub End Module If we want to display only id and name of all the records, What would be the cmdstr? Choice a "SELECT * from account" Choice b "SELECT id, name from account" Choice c "SELECT id, name, bal from account" Choice d None of the above. [27] Consider the following scenario: Suppose we are using SQL server database named bank. There is a table named account. which has fields named id, name, bal, and has the following records. 1 Sunil 3450 2 Sushil 4500 3 Rahul 5000 Suppose that uid = sa; password = thanks; Which of the following connection string, is correct to access the database? Choice a Choice b Choice c Choice d "Server = < computer name >; Data base = bank; uid = sa; pwd = thanks" "Server = < computer name >; Database = bank; uid = sa; pwd = thanks" "Server = < computer name >; Database = bank; Trusted_Connection = TRUE" "Server = < computer name >; Database = bank; Integrated Security = SSPI"

[26] Which of the following property sets the position of a menu item when its parent menu is merged with another menu? Choice a MergeMenu Choice b MergeOrder Choice c MergeType Choice d MergeItem

[25] Which of the following code sets the TextBox control to be multiline and adds vertical scroll bars to it? Choice a Public Sub New ( )

MyBase.New ( ) InitializeComponent ( ) TextBox1.Multiline = False TextBox1.ScrollBars = ScrollBars.Vertical End Sub Choice b Public Sub New ( ) MyBase.New ( ) InitializeComponent ( ) TextBox1.Multiline = True TextBox1.ScrollBars = ScrollBars.Vertical End Sub Choice c Public Sub New ( ) MyBase.New ( ) InitializeComponent ( ) TextBox1.Multiline = True TextBox1.ScrollBars = ScrollBars.Horiozontal End Sub

Choice d Public Sub New ( ) MyBase.New ( ) InitializeComponent ( ) TextBox1.Multiline = True TextBox1.ScrollBars = Vertical End Sub

[24] The control which allows the user to enter and edit text is Choice a Label Choice b GroupBox Choice c TextBox Choice d ListBox [23] Which of the following elements are required to raise an event named EventName? Choice a A class that holds event data , named EventNameEventArgs.
This class must derive from System.EventArgs.

Choice b Choice c

Choice d

A delegate for the event, named EventNameEventHandler. A class that raises the event. This class must provide: An event declaration: Public Event EventName As EventNameEventHandler A method named OnEventName that raises the event. All of the above

[22] The delegate used to create the mouse event handler is Choice a MouseEventHandler Choice b MouseArgHandler Choice c MouseHandler Choice d None of the above [4] The data type which can hold logical values is Choice a Boolean Choice b Byte Choice c Date Choice d Single 19] Which of the following class is provided if an unassigned reference is used? Choice a FormatException Choice b OutOfMemoryException Choice c NullReferenceException Choice d ArithmeticException [18] The class that implement the IDictionary interface is Choice a ArrayList and Array Choice b SortedList Choice c HashTable Choice d Both 2 and 3 [17] The class that implement the IList interface is Choice a ArrayList and Array Choice b SortedList Choice c HashTable Choice d Stack and queue [16] Consider following code snippet: Public Enum Seasons Summer = 1 Autumn = 2 Winter = 4 Spring = 8 All = Summer Or Autumn Or Winter Or Spring End Enum Module Module1 Sub main ( ) Dim s As Seasons s = Seasons.All Console.WriteLine ( s ) End Sub End Module

What would be the output of the above code? Choice a Choice b Choice c Choice d 1248 0 15 16

[15] The array object created on heap is derived from Choice a System Choice b System.Array.Object Choice c System.Array Choice d System.Object.Array [14] The multidimensional array in which the number of elements in each row is same and which occupy adjacent memory location is Choice a Jagged array Choice b Rectangular array Choice c Circular array Choice d Both 1 and 2 [13] The property which does not have a Set portion is called as Choice a WriteOnly property Choice b ReadOnly property Choice c Indexed property Choice d 2D Indexed property 11] The keyword used to prevent a class from getting inherited is Choice a NoBase Choice b NotInherit Choice c NotOverloadable Choice d NotInheritable [3] Which of the following applications can be developed in VB.NET? Choice a Component Library Choice b Mobile Applications Choice c a Distributed Applications Choice d All of the above