Tuesday, May 30, 2006

VB.net

Chapter 1
Getting Started with .NET

1. In case of fat client the business services layer is combined with data services layer.
In n tier application the data services layer is composed of multiple servers
True/False

2. The .Net framework class library comprises of assemblies contained within namespaces
Namespaces can be used to avoid name collisions
True/false

3. The assembly is a single deployable unit that contains all info about the implementations of classes, interfaces and structures.
Assemblies provide the runtime with functionalities like exception handling, security, debugging, versioning.
True/false

4. When u compile a program that targets the CLR, the source code is converted to _____
a. Compiled code
b. Native Code
c. MSIL code
d. JIT code

5. Which feature of CLR ensures that the size of the integer and other variables is the same across all programming languages?
a. Memory Mgmt
b. Language Interoperability
c. Standard type System
d. Platform Independence

6. Which of the above maximizes code reuse?

7. Which of the following is an IDE?
a. .NET framework
b. .Net Visual Studio
c. VB .net
d. C#

8. Which feature of VB.net allows you to redefine the method of the base class in the derived class?
a. Overriding
b. Overloading
c. Threading
d. Inheritance

9. Which of the code depicts Inheritance?
a. class A inherits class B
end class
b. class A inherits B
end class
c. class A : B
end class
d. class A extends B
end class

10. The _______ keyword is used in the base class if a method is to be overridden
a. overriding
b. overloading
c. overridable
d. overloads

11. A solution contains items that are interrelated.
A project acts as a container for one or more projects.
True/false

12. What template will you select to create a custom control that can be added to the user interface?
a. ASP.net Web Control
b. Windows Control Library
c. Windows Application
d. Class Library

13. ______ is used to design the user interface for an application.
a. Code Editor
b. Server Explorer
c. Solution Explorer
d. Windows Form Designer

14. What is the extension of the file created after building a windows application?
a. .vb
b. .dll
c. .exe
d. .cs

15. Which window displays messages for the status of various features provided in Visual Studio.net?
a. Output windows
b. Task list window
c. Server Explorer window
d. Solution Explorer

16. Which of the above displays data connections and performance counters?

17. Which of the above displays a list of errors along with the source?

18. Which navigational feature allows u to glue a window to one of the edges of the parent window?
a. tabbed Navigation
b. auto hide
c. docking
d. tabbed bar

19. Which property of Windows Forms is used to specify whether form is displayed as normal , minimized or maximized?
a. StartPosition
b. Text
c. Size
d. WindowState

20. Which feature of CLR enables programmers to reuse existing code by creating and maintaining a single code library?Common type systemVersioningFree threadingStructured exception handling

21. What are the various components of the .Net Framework?

22. Which feature of Visual Basic.NET enable you to create multiple methods that have identical names but different functionality?InheritanceOverloadingVersioningNesting



23. Which component of.NET Framework enables an organization to create services and applications that can run on multiple platforms ranging from stand-alone computers to the Internet?Common Language RuntimeVisual Studio.NET.NET Building Block ServicesADO.NET
24. What is an assembly?

25. What is Inheritance?

26. What is overriding?

27. What is presentation Layer?

28. What is monolithic application?

29. Explain Two tier, Fat Clients and two Tier architecture.

30. What are Namespaces?

31. Explain Structured Exception Handling

32. Explain Multi Threading

33. Explain Constructor and Destructor
Chapter 2
Creating Windows Form

1. Which data type can store a range of values between 0 and 65535
a. char
b. long
c. int
d. short

2. How do u declare an array to store 5 integers in vb.net?
a. dim x(5) as integer
b. dim x[5] as integer
c. dim x(4) as integer
d. dim x[4] as integer

3. What is output of the following code?
dim x as integer = 20
dim s as string =”sam”
msgbox (“name is ” + s + x)
a. name is sam20
b. name is sam 20
c. error
d. name is sam

4. Which property of a textbox allows u to set what char appears when passwords are typed?
a. password
b. passwordchar
c. charpassword
d. char

5. What controls should u use to accept name, select qualifications as in grad, post grad, select cities from a given list only and select options like residence or office
a. textbox for name, listbox for qualifications, listbox for city , checkbox for res/off
b. textbox for name, combobox for qualifications, listbox for city , radiobuttons for res/off
c. textbox for name, checkbox for qualifications, listbox for city , radiobuttons for res/off
d. textbox for name, checkbox for qualifications, combobox for city , checkbox for res/off


6. What is Windows Form?

7. What is an Event?

8. Explain Array
Chapter 3
Implementing Object Oriented Programming in Visual Basic .net
1) Nancy is developing a database application. She opens a data base connection named "con" to access the data in the database. She wants to release the resources manually by closing the data base connection when it is no longer required. What should she do to accomplish this task?
Options
Create a Dispose() method in the class.
Override Finalize() method in the class.
Create a Destroy() method in the class.
You cannot manually release the resources in Visual Basic .Net.


2) Which access in VB specifier.net allows a structure to be accesible from the same assembly and the derived classes?
a. friend
b. protected friend
c. public
d. protected

3) _____ keyword is used in VB.net to create abstract classes.
a. interface
b. abstract
c. overridable
d. mustinherit

4) interface ValidateCust
sub checkAge()
end sub
end interface
What is wrong with above declaration?
a. Nothing
b. Interface should be declared public
c. The procedure should be declared public
d. The procedure should not have end sub

5) The module in an assembly is the descriptor of the assembly
The type can be a class or a structure that contains data.
True/false

6) How do u create a namespace in vb.net?
a. Namespace a
End namespace
b. Import namespace a
c. Imports namespace
d. Imports a

7) Explain Class

8) Explain Object

9) Explain Structure

10) Explain Procedure

11)Explain Interface

12)What is the difference between class and structure?

13) Why is a structure called a composite data type?

14) How are interfaces different from abstract classes?

15) What are assemblies?

16) Explain Namespaces

17) Explain Constructor

18) Explain Destructor

19) public class form1
inherits System.Windows.Forms.Form
private sub btn_click(sender as Object, e as EventArgs) Handles btn.click
dim obj as new class1()
dim obj1 as new class1()
end sub
end class
public class class1
shared num as integer = 10
public sub new()
num = num + 1
Msgbox (“number of instances are :” & num)
End sub
Shared sub new()
End sub
End class

What is output if button is clicked?
a. Error as shared variable cannot be accessed from non shared method
b. Number of insatnces are 1
Number of insatnces are 2
c. Number of insatnces are 11
Number of insatnces are 12
d. Number of insatnces are 10
Number of insatnces are 10

20) The Finalize() destructor is called after last reference to an object is released from memory.
The Dispose () method is called by .Net framework automatically
True/Falses
Chapter 4
Creating Windows Form
1) Sub disp (x as integer) as integer
return x+5
end sub
Sub button1_click (as object e, as Event Args) handles Button1.click
dim y as integer = 10
dim x as integer
x=disp(y)
msgbox(x)
msgbox(y)
end sub
What is the output?
a) 15 10
b) 15 15
c) 10 15
d) error
2) You can specify an argument as optional by using the keyword optional - True/False
3) There can be more than one optional argument in a procedure - True/False
4) In vb.net the default argument passing mechanism is By Val - True/False
5) When a variable is passed by reference, the procedure can change the value of the variable - True/ False.
6) sub increase (byref x as integer)
x=x+1
sub replace (y as integer)
y=y+1
end sub
sub button1_click( s as object, o as Event Args) handles.click
dim a as integer = 5
increase(a)
replace(a)
msgbox(a)
end sub
a) 7
b) 5
c) 6
d) no output
7) How do you create a properly procedure?
a. public property empname()
get
end get
set (value as string)
end set
b. public property empname() as string
public get
public set (values as string)
end set
end property
c. public property empname() as string
get
end get
set (value as string)
end set
end property
d. public property empname() as string
get
end get
set
end set
end property