1.i) c# application we can access through .net plotform
ii)The foremost goal for C# programming language was similicity.
a) i b) ii c) all d)none ans c
2. i).Net languages are having common data types and class for developling applications
ii) To install .NET frame wordk SDK, it's free you can down load it from microsoft site.
a) i, ii b) ii c) i d)None ans a
3. i) C# is a product of Sunmicro Systems
ii) Many c# statements are barrowed from directly NGWS
a)i b)i, ii c)Both d)none ans b
4.i) Garbage collector is provided by NGWS
ii) Contributing to the ease of use is the adding certian features of c++
a) i b) i, ii c) ii d) None ans a
5.i) The directive_____________causes the preprocessor to report a fatal error
ii) C# added new features such as type satety, versioning etc.
a) i, ii b) ii c)i d)None ans a
6 .i) Net includes a common execution engine and a rich class library.
ii) By default , developers works with managed code in c#.
a) i b) ii c)i, ii d)None ans c
7 i)The c# aim is to combine the high productivity of Visual Basic and the raw power of C++.
ii) Direct memory manipulation is allows in unsafemode
a) i, ii b) ii c)i d)None ans c
8.i) To Develop C# Microsoft has taken take care of c++ problems such as memory management, pointers etc.
ii) c# also gets rid of redundancies that crept into c++.
a) i, ii b) ii c)i d)None ans a
9. i) C# is a like java language for web programming.
ii)The financial types are welcome addition for enterprise level programing language.
a) i b) ii,i c)i d)None ans b
10.i) C# is intented to the premier language for writing WFC.
ii) The typesfe enforced to guarantee application stability
a) i, ii b) ii c)i d)None ans b
11 i) C# is modern,simple,entirely object oriented and type safe.
ii) if you need multiple interfaces, you should implement interfaces
a) i, ii b) ii c)i d)None ans a
12 The runtime c# is not provides Garbage collector that is responsible for memory management.
a)False b)True ans a
13C# provides metadata syntax for declaring capabilities and permissions for the underlying NGWS security
a)True b)False ans a
14 i) The entire c# class model is built on top of the NGWS runtime's Virtual Analysis Content.
ii) The VOS makes c# more readable and increases potential naming conflicts.
a) i, ii b) ii c)i d)None ans d
15.The CLS(common language specification) defines
a standard for interoperation between languages that adhere to this standard.
a)False b)True ans b
16.i) The NGWS runtime provides transparent acces to COM Integration with legacy code.
ii) c# does its best to support this versioning.
a) i, ii b) ii c)i d)None ans a
17.i) Any entry point in a DLL given its C_Styledness.
ii) The programmers can deals the implications of dealing with our own memory in unsafe mode.
a) i b) ii c)i,ii d)None ans c
18.i) cstylendess is a feature for accesing native API's is called Plotform invocation services.
ii)#elif is processed only if the originial #if condition is failed.
a) i b) ii c)i,ii d)None ans c
19 i)To entry point to a c# application is the using system;
ii)Static method means that the method can be called without creating an instance of the class.
a) i b) ii c)i,ii d)None ans c
20) i) The {0} replaces the first variable of Console.write statement
ii) Modern applications top requirement is security
a) i,ii b) ii c)i,ii d)None ans a
Unit 2
1. i) In C# types are divided into two types
ii).Reference types are divided into six types
a) i,ii b) ii c)i,ii d)None ans a
3.The object type is used when a value type is ___________
a)unboxed *b)boxed c)both d)None ans a
4.A__________declares a ___________type that has abstract members only. ans a
a) interface,reference b)reference,interface c)None
5.i)A interface encapsulates a method with a certain signature.
ii)C# does not suppory multiple inheritance directly
a) i,ii b) ii c)i d)None ans a
6.____refers to implicitly converting any value type to the type object. ans b
a)unboxing b)boxing c)both d)None
7.i)In C# we can not use uninitilized variables.
ii) C# does allows to cast from an integer to a reference type.
a) i,ii b) ii c)i d)None ans c
8)In C# arthmetic operations could overflow the range of the result data type. ans true
a)True b)False
9.i)A processor directive must be the only instruction on a line
ii)Region and Unregion directives are also available in c,c++
a) i,ii b) ii c)i d)None ans c
10.We can use line control to inform the compiler of where each source line originally came from. ans b
a)False b)True
11.At compile time user can define as below. ans b
csc/define:Test userdrvl.cs
a)False b)True
12.i) ushort is under bool type
a)True *b)False
ii)C# provides nine integral types
a)False *b)True
a) i b) ii c)i,ii d)None ans b
13.i) The bool data type represents the Boolean values true or false
ii)Can we assign an expression to boolean
a) i,ii b) ii c)i d)None ans a
14.i) In C# there is no implict converion from char to other data types
ii)Can we define methods,properties,indexeres in an interface
a) i,ii b) ii c)i d)None ans a
15.i)Basically delegates are safe type
ii)The string class is derived from directly Object.
a) i,ii b) ii c)i d)None ans a
16.i)can we story any type of object in array.
ii)A Unbox is an explicit operation
a) i,ii b) ii c)i d)None ans a
17.When a single expression contains multiple operators, the execution sequence is decided by the priority of each operator. ans b
a)False b)True
18. You can encapsulate both static and instance methods in a delegate instance. although you can use delegates as is with methods, their main use is with a class event.
a) true b)false ans a.
19.During the comparasion string performes compares the values, not the references. here references are nothing but memory address
a)true b)false ans a
20. i) When you decide to use interfaces in your class design, it is a good idea to learn more about object oriented design.
ii) A class can not contain fileds, events.
a) ii b)i, I i c)i d)None ans b.
Unit 3
1.i)An abstract class can be instantiated
ii)extern tells the compilter that the method is actually implemented externally.
a) i,ii b) ii c)i d)None ans b
2._____________is used to modify a method or accessor that is defined virtual in anyof the base class. ans c
a)extern b)readonly c)override d)None
3.virtual indicates that the method or accessor can be overridden by inheriting classes. ans b
a)False b)True
4.________________access is granted to all code that is part of the same NGWS component. ans a
a)public b)private c)protected d)internal
5.i)The iteration variable is declared by type and identifier
ii) In general , a constructors are always public.
a) i,ii b) ii c)i d)None ans a
6.There are two ways to expose named attributes for a class. ans b
a)False b)True
7.i) get property allows to read the property value
ii) set property allows to set the property value.
a) i b) ii c)i,ii d)None ans c
8.i)Events can be declared either as class fields or as properties.
ii)class modifiers are divided into 3 types
a) i,ii b) ii c)i d)None ans a
9.The derived class must implement all abstract members of the abstract base class.
a)False b)True ans b
10.i)can we instantiate an abstract class.
ii)GetEnvironmentVariable() is member function of Environment class.
a) i,ii b) ii c)i d)None ans a
11 i) Even if you dont write a constructor, a default constructor will be available for you.
ii) you can create a events ans subscribing clients to event via delegates
a) i b)I i c)i,ii d)None ans c.
12. i)private means that the constructor is not accessble from the outside of the class.
ii) It can not be called, and no object can be instantiated from the class.
a) i,ii b) ii c)i d)None ans a
13.i) The major part of functionality is implememnted in methods
ii) The object initializes and terminates properly.
a) i b) ii,i c)i d)None ans b
14.There is one method that you should consider writing when you hold references to expensive resources, a Method that can be called explicitly to release all thoseresources.
a) false b)true ans b.
15.i) A method to process changing values
ii) in,out,ref deals with issue that arise from passing values in and gettting results back to the caller.
a) i,ii b) ii c)i d)None ans a
16. The variable out must be initialized , otherwise the compiler will give problem
a) false b)true ans b
17.i)Polymorphism means that in a derived class you can redefine methods of a base class.
ii)when overriding a method of a base class, you must be aware that you can not change the accessbility of the method.
a) i b) ii c)i,ii d)None ans c
18. A different way of redefining methods is to hide base class methods. This feature is especially valuable when you derive from a class.
a) false b)true ans b.
19.i)fields,properties are allows to expose named attributes
ii)set property allows to mark to modify a value
a) i,ii b) ii c)i d)None ans a
20.The implementation rules for get and set are the same as for properties. Almost free in defining the parameter list.
a ) false b)false ans b.
Unit 4
1.i)An exception thrown in c# can not be handled in visual basic client.
ii)ArgumentNullException raised by the runtime when a null object is referenced.
a) i,ii b) ii c)i d)None ans b
2.i)Cross language exception is best feature for .net application.
ii)ArgumentOutofRangeException thrown by a method when an argument is not within a given range
a) i,ii b) ii c)i d)None ans a
3. While performing a calculation, it can happen that the computed result exceeds the valid range of the result variable's data type.This situation is called overflow
a)true b)false ans a
4. When we want to control voerflow checking for the entire application then load at the C# compiler setting checked.This is explicitly request
a) true b)false ans a
5. The following three sections can handle exceptions
i) catching with try-cath
ii) cleaning up with try_finally
iii) Handling all with try_catch_finally
a) i, ii b)ii, iii c) i,ii,iii d)None ans c
6.i)Try encloses the statements tht might throw an exception.
ii)catch handles an exception if one exists.
a) i b)ii c)i,ii ans c
7.i)ComException containing COM classic's HRESULT information
ii)Conditional compilation enable to exclude or include code based on certain conditions.
a) i b)ii c)i,ii ans c
8.i)try and catch does not supress the error message.
ii)exception object never releases attributes to access.
a) i b)ii,i c)ii ans b
9)i)The most likely approach for applications is to merge the prior two error handling techniques.
ii)Normally a try follows more catch blocks
a) i b)ii c)i,ii ans c
10) i) Do throw exceptions only when the condition is really exceptional.
ii)Do throw the most appropriate exception
a) i b)ii c)i,ii ans c
11.i)Don't use exceptions for normal or expected errors
ii)Don't use exceptions for normal control of flow.
a) i b)ii c)i,ii ans c
12.i) If you are inside a catch statement, you can decide to throw the exception.
ii) when you have to catch exceptions it must be thrown in the first place.
a) i b)ii,i c)ii ans b
13.An exception object we can not pass to a method with ref or out modifiers.
a) true b)false ans a
14.c# silently handles overflow situations, to change this behaviour by enabling overflow checking for the entire application or on a statement by statement basis.
a) true b)false ans a
15.The big advantages of the NGWS runtime is that exception handling is standardized across langues.
a)false b)true ans b
Unit 5
1.i) The hierarchical nature of the organization makes it easy to present elements of a program to other programs.
ii) In c# , two ways are there to perform conditional compilation
a) i b)ii c)i,ii d)None ans c
2.i)Namespaces are a good way of internally organizing the applications.
ii)Every Documentation comment starts with a triple forward_slash
a) i,ii b)ii c)i,ii d)None ans a
3.i)To create namespaces to identify the hierarchy of application clearly.
ii)in namespaces,if you do not add a specific access modifier, all types will be internal by default.
a) i b)i,ii c)i,ii d)None ans b
4.The following sections show how to use namespaces when building components applications.
i) wrapping a class in a namespace ii) using namespaces in server side application
a) i b)i,ii c)i,ii d)None ans a
5.To create logical groups c# providing namespaces. while create xml related classes ,
all classes can be created in one namespace called xml and we in name space is called web.
a)false b)true and b
6. i) On other hand you can also use the using directive to include the namespaces in the class.
ii) To avoids writing functions using hierarchical mode, each time it is called.
a) i b)i,ii c)i d)None ans b
7. The following sections show how to build a component and the client that uses it.
i) building the component ii) compiling the component iii) creating a simple client app
a) i, ii b) ii,iii c) i, ii,iii d)None
8. When the component is written and successfully compiled, all tht is required is to use it in server side application.
a)true b)false ans b.
9. we create components to allow other programs to call code from it. while compiling the client program the developer do not indicate the source dll file.
a)false b)true ans a
10.i)Databases are centralized stores of data. In a database , information from several file is accessed and operated upon as if in a multiple files.
ii) The data base organizes data dependently
a) i b)i,ii c)i,ii d)None ans d
11.i)After connecting data base we have to open the connection.
ii)The open method will be exectuted based on dsn.
a) i b)i,ii c)i,ii d)None ans b
12.Another important aspect to be noted is to ensure that the record pointer must be positioned on the first record when retrived.
a)false b)true ans b
3.i)A Record Pointer is an Abstract class ans b
ii)ADOConnection requires one argument
a) i b)i,ii c)ii d)None ans b
14.i) The Getvalue() function needs the field number as argument.
ii)ExecuteNonQuery method executes SQL statements.
a) i b)i,ii c)ii d)None ans b
5.i) In C# the preprocessor is emulated by the compiler itself.
ii)ADOConnection class is required System.Data.dll
a) i b)i,ii c)i,ii d)None ans b
Unit - 1
III. Each Question Carries 4 Marks
Select true statements
1) After selecting the operating system.
i) Install internet explorer 5.5
ii) Ater installing these you can write your code in any text editor and save it as .cs extension
iii) Install microsoft .net framework SDK.arrange the above statemenr in order.
a) i, ii, iii b) ii, iii,i c)i,iii,ii d) none ans C
2) i) An important point about c# is that is it a modern programming language, it simplifier and modernized c++ in the
areas of classses, namespaces etc.
ii) Contribiting to the ease of use is the elimination of certain of C++, no macros, no templates and no multiple
inheritance.
iii) c# features are targeted at developing a component-oriented software.
a) i , ii, iii b) iii,i c)i,ii d) ii, iii ans a
3) i)in C# you can notice right from the start that there no more global functions,variables,costants.
ii) when you are used to programming classes in c++, you know that you can set different access levels for class members by using access modifiers
iii) C# is providing only one base which allows to create set derived classes
a) i,ii, iii b)iii,i c)i,ii d)ii,iii ans a
4) i) For member variables of an object the linker takes care to initilize zero.
ii) when you downcast, c# verifies that this cast is OK or Not
iii) overflow can allows to check either application lever or statement level
a) i,ii, iii b) iii,i c)iii,ii d)none ans C
5) i) To enforce CLS compliance, tht compiler of c# checks that all publicly exported entities comply,and raise an error
if they do not.
ii) for access COM object, NGWS is providing transparent access to COM ingegration with legacy code.
iii)C# enables to inter operate with C-style API's .
a) i, ii, iii b) ii, i c)iii,ii d)none ans a
6) i)An unsafe allows to declare certain classes or methods
ii)managed code implies that no marshaling is incurred when calling unsafe code from safe code
iii)Garbage collector never touch our memory locations in unsfae mode.
7) i) class calss1
{ static void main(string args[])
{}
}
ii) class calss1
{ static void Main(CString args[])
{}
}
iii) class calss1
{ static void Main(string []args)
{}
}
which is the correct syntax
a) i b) ii c)iii d)all ans c
8) i) NGWS runtime ships with all compilers (VB,C++, C#)
ii) all sources files are having an extension name is . Csc
iii) csc /out:hello.exe hello.csc , This statement tells the linker that output file is to be
names hello.exe
a)ii, iii b) iii,I c)i,ii d) i ans d
9) i) The c++ preprocessor is a macro that is used automatically by the c++ compiler.
ii) The compiler transform your program before actual compilation.
iii) In this concept C# has taken only from C.
a) i,ii, iii b) iii,i c)i,ii d)none ans a
10) i) Region and endregion introduces only from c#
ii) Preprocess directives are 3 types such as conditional, line, error and warning controls.
iii)csc /define : TEST user.cs , the statement defines the user can define at compile time.
a) i,ii, iii b) iii,i c)i,ii d)none ans a
Unit - 2.
1) Find out the following programs output.
#define DEBUG
#difine MANIPAL
using System;
class elif
{ public static void Main()
{
#if(DEBUG && !MANIPAL )
console.WriteLine("Debug is defined ");
#elif (!DEBUG && MANIPAL)
console.WriteLine("Manipal is defined ");
#elif (DEBUG && _MANIPAL)
console.WriteLine("Debug and Manipal are defined ");
#else
console.WriteLine("Debug and Manipal are not defined ");
#endif
}
}
a) compile error b)run time error c) None ans c
2) #define DEBUG
class error
{ public static void Main()
{
#if DEBUG
#error DEBUG IS DEFINED
#endif
}
}
a) compile error b)run time error c) debug is defined ans a
3) class line
{ public static void Main()
{
#line 100 "abc.cs"
intt i
}
}
a) abc.cs not found b) intt could not found c) None ans b
4) i) A variable of a certain value type always contains a value of that type.
ii) c# forces to initialize variables before you use them.
iii) The actual value of variable remains at the same memory location.
a)i,ii, iii b) iii,i c)i,ii d)none ans a
5) i) char ch='A';
ii) char ch='\x0065';
iii) char ch='\u0065';
iv) There is no implicit conversion from char to other data types.
a)i,ii, iii b) iii,i c)i,ii d)i,ii,iii,iv ans d
6) When performing calculations with either of the floating point types, check out the following value are true or false
i) positive to negative zero ii) positive and negative infinity
iii) not a number value iv) The finite set of nonzero values
a)true b)false ans a.
7) i) A struct can declare construtors,constants,fields,methods,properties, indexers,operators,nested types
ii) A struct is reference type.
iii) A class is value type.
)i,ii, iii b) iii,i c)i,ii d)i ans d
8) i) For creating lightweight object we are using structs.
ii) A class allows to declare inside struct
iii) A class can have events, member functions etc,.
a)i,ii, iii b) iii,i c)i,ii d)none ans a
9) find out valid statements
i) enum Months = { JAN,FEB,MARCH };
ii) enum Months{ JAN,FEB,MARCH };
iii)enum Months{ JAN=10,FEB,MARCH=20 };
iv)enum Months :byte { JAN,FEB,MARCH };
a) i,ii, iii b) iii,i ,iv c)ii,iv d)ii,iii,iv ans d
10) i) when a single expression contains multiple operators , the execution sequence is decided by the priority of
each operator.
ii) in unboxing, you have to tell the compiler which value type you want to extract from the object.
iii) when a value type is boxed, an object instance is allocated and the value of the value type is copied into the
new object.
a) i,ii, iii b) iii,i c)ii,ii d)none ans d
Unit - 3
1) Match the following
Team A Team B
a) delegates i) refers to implicitly converting any value type to the type object
b) reference type ii) It checks that the value type you request actually stored in the object instance or not
c) boxing iii) it do not store the actual data but store references to the actual data.
d) unboxing iv) It encapsulates a method with a certain signature.
a) a-iv, b-iii, c-i, d-ii b) a-iv, b-ii, c-i, d-iii
c) a-1,b-ii,c-iii,d-iv c) None ans a
2) Match the Member Modifiers?
Type A Type B
a) Abstract i) It tells the compiler that the method is actually implemented externally
b) Const ii) Defines a field or property.
c) event iii) This modifier applies to fields and local variables.
d) extern iv) Indicates that a method or accessor does not contain an implementation.
a) a-iv, b-iii, c-ii, d-i b) a-i, b-ii, c-iii, d-iv
c) a-iv, b-ii, c-iii, d-I d) None ans a
3) Match the following
Type A Type B
a) Get Hostname() i)It is a symbolic name that can mapped into IP number.
b) GetHostByname() ii) Is a unique address by each host on the internet
c) Host name iii) It allows you to provide lower level services to provide Higher level services
d) IP number iv) It returns local host name
e) protocol stack v) It returns IP host entry
a) a-v, b-iv, c-i, d-ii,e-iii b) a-iv, b-v, c-i, d-ii, e-iii
b) a-iii, b-v, c-ii, d-i, e-iv d) None ans a.
4) Find out the output?
Class test
{
static void main fun(int x.out)
x=20;
}
public static void main( )
{
int c;
fun(out c);
Console.writeline(“value is” +c);
}
}
A) Error b)20 c)parameter not allow d)none ans b
5) Find out the output?
Calss A
{
public int india
{
get
{
return 12;
}
}
}
class test
{
public static void main( )
{
A x=new A();
x.india=10;
Console.Writeline(x.india):
}
}
A)10 b)12 c)error d)none ans b
6) Find out the output?
Using system
Namespace sss
{
public class s
{
public int r;
{
get
{
return 10;
}
}}
class class1
{
public static void main( )
{
s a=new s();
a.r=100;
Console.writeline(a.f);
}
}
A)100 b)10 c)10,100 d)none ans b
7) Find out the output?
Public class say
{
public int r;
{
get
{
return 10;
}
set
{
Console.writeline(“value is “,value);
}
}
}
class class1
{
public static void main( )
{
say a=new say( );
a.r=100;
console.writeline(a.r);
}
}
A)10 b)100 c)error d)none ans c
8)Find out the output?
public class x
{
public void fun(out int x1)
{
x1=100;
}
}
class class1
{
public static void main( )
{
int k;
x a =new x( );
a.fun(out k);
Console.writeline(“value from main”+k);;
}
}
A)Out parameter cann’t call in main b)100
c)error d)none ans c.
9) find out the output?
Class class1
{
static void main(string[]args)
{
enum x{a,b,c=10};
Console.writeline(a+” “+b+ “ “+c);
}
}
a)10,10,10 b)0,1,10 c)error d)none ans b.
10)find out the output?
Public class x {
public void fun(ref int x1,ref int x2)
{
x1=x1+x2;
x2=x1-x2;
x1=x1-x2;
} }
class class1
{
public static void main( )
{
int a=10;b=20;
x a1=new x();
a1.fun(ref a,ref b);
Console.writeline(“a value is’+a+” b value is “+b);
}
}
A)cann’t refer the values b)10,20 c)20,10 d ) none ans c
11) class Test
{
public Test() : base() {}
}
in the above program base class constructor is provided by
a) linker b)compiler c)user d)None ans b.
12.i) A constructor always has the same name as the class
ii) it does not have a return value
iii) it should be public .
iv) it can be overloaded.
a) i, ii, iii,iv b) iii, ii, i c) iv, i d)None ans a.
13) i) we use generally destructor to release memory clean up implictly.
ii) private constructor is not accessble from out side of the class.
iii) The Release method invocation in the destructor is not mandatory.
a) i,ii b) iii, ii, i c) iii, i d)None ans b
14) i) Method overriding is depend on the principle of polymorphism.
ii) Methods are three sections such as method parameters,overriding, method hiding
iii) An interface does not contain data.
a) i, ii,iii b) i, ii c) iii d)None ans a
15). class BaseClass
{
public void TestMethod()
{Console.WriteLine("hai world"); }
}
class Derived : BaseClass
{
new public void TestMethod()
{Console.WriteLine("hai world"); }
}
class Test
{
public static void Main()
{
Derived d=new Derived();
((BaseClass)d).TestMethod();
}
}
the above example tells us the concept of
a) Method overloading b) method overriding c) method hiding d) None ans c
Unit - 4
1) Match the following
Team A Team B
a) System Exception i) base class for all errors generated during runtime
b) ComException ii) Exception encapsulating win32 structured exception-handling information
c) SEHException iii) Exception containing COM classic’s HRESULT information
a) a-i, b-ii, c-iii b) a-i, b-iii, c-ii c) a-iii, b-ii, c-ii d) None ans b
2) Find out the output?
Class test
{ public static void main( )
{
try
{
int x=2;
fun1();
Console.writeline(x/0);
}
catch ( Exception e)
{
Console.writeline(“main”);
}
}
static void fun1()
{
try
{
Console.writeline(10/0)
Console.writeline(“hello’);
}
catch(Exception e)
{
Console.writeline(“fun1”);
}
finally
{
Console.writeline(“final from function”);
}}}
a) fun1, final from function, main b) Error
c) fun1, main, final from function d) final from function, main, fun1 ans a
3) Match the following
Type A Type B
a) overflow exceptions i) Runtime Exceptions
b) NullReference Exceptions ii) Object based Exceptions
c) MissingMethod Exceptions
d) ExecutionEngine Exceptions
e) InvalidOperation Exceptions
f) TypeLoad Exception
g) Security Exceptions
h) Argument Exceptions
i) ArgumentNull Exceptions
A) a-ii, b-ii, c-i, d-i, e-i, f-ii, g-ii, h-i, i-ii B) a-i, b-i, c-i, d-i, e-ii, f-ii, g-i, h-ii, i-i
C) a-i, b-ii, c-ii, d-i, e-i, f-ii, g-ii, h-ii, i-ii D) None ans a
4) Match the following
Type A Type B
a) Exception i) Base class for all exception objects
b) InteropException ii) Base class for exceptions that are targeted at or occur in environments outside the
NGWS runtime
c) Argument Exception iii) Base class of all argument exceptions
a) a-i, b-ii, c-iii b) a-ii, b-i, c-iii
c) a-i, b-iii, c-ii d) none ans a
5) Find out correct statement which are allows to handle exceptions
i) catching with try-cath ii) cleaning up with try-finally
iii) handling all with try-catch-finally iv) handling all with try-throw-throws
a) i, ii,iv b) ii,iii, iv c) i,ii,iii d)all ans c.
6) select which are true statements
i) a try can have one or more catch blocks ii) a try atleast requires one catch or finally blocks
iii) a try can have more finally blocks
a) i, ii b) ii, iii c)all d)None ans a.
7) EXCEPTION_CONTINUE_EXECUTION
i) The identifier available in SEH exception filters. ii) it enables to re_execute the piece of code.
a) i b) ii c)Both d)None ans c.
8) Match the following
Type A Type B
A) class modifiers i) abstract, sealed
B) Member modifiers ii) abstract,const,event,extern,override,readonly,static,virtual
C) Access modifiers iii) public,protected,private,internal
a) A-i, B-ii, C-iii b) A-i, B-iii, C-ii c)A-iii, B-ii, C-ii ans a
9. i) GetEnvironmentVariables() returns an interface is a type of IDictionary.
ii)IDictionary is having key and value
iii)The above two are available System.collections namespace
a) i, ii b) ii, iii c)all d)None ans c
10) i) get and set : these two are read and write properties
ii) The DNS is part of System.Net;
iii)This namespace is not contained in the core library, we can reference the library in our compiler statement.
a) i, ii b) i, ii, iii c) iii d)None ans b.
Unit - 5 & 6
1) i) c# uses namespaces to orgranise programs in a specified manner
ii) The hirarchical nature of the organization makes easy to present elements of programs
iii) Namespaces are good way of internally organizing the applications.
a) i, ii b) i, ii, iii c) iii d)None ans b.
2) i) All namespaces are having by default access specifier is internal
ii) Namespaces we can use at client side applications as well as wrapping a class in namespace
iii)Basically namespaces are allows to create the logical groups in our applications
a) i, ii b) i, ii, iii c) iii d)None ans b.
3) i) Using dll files we can call components
ii) while compiling the client program we have to indicate dll file
iii) Conditional compilation enables to exclude or include code based on certain conditions.
a) i, ii b) i, ii, iii c) iii d)None ans b.
4) i) The preprocessor is emulated by the compiler itself
ii) c# compiler does not support macros
iii) compiler can user directives globally to all files
a) i, ii b) i, iii c) iii d)all of the above ans d.
5) i) The param keyword enables to specify a method parameter that actually takes any number of arguments
ii) param is similar to c/c++ ellipsis
iii)The intension of using the paramskeyword is to have to Trace the method.
a) i, ii b) i, ii, iii c) iii d)None ans b.
6) i) Every documentation comment starts with a triple forward_slass (///)
ii) you can add paragraphs using
iii)cref allows to add the link
a) i, ii b) i, ii, iii c) iii d)None ans b.
7) i)
ii)
iii) QFE stands for Quick fix Engineering
a) i, ii b) i, ii, iii c) iii d)None ans b.
8) i) N - Denotes a Namespace T- Identifies Type
ii) F - Describes a filed of class P- referes to a property
iii) M - identifies a Method E- events are denoted ! - denotes an error
a) i, ii b) i, ii, iii c) iii d)None ans b.
9) Find out the output?
using system.data.ADO
class mydb
{
public static void main( )
{
try
{
ADOConnection ac=ADOCommand(“Data source=MIT”);
Ac.open();
Console.writeline(“database is connected”);
}
catch(System.Exception e)
{
Console.writeline(“error”);
}
}
}
A) Raising exception B) database connected C) database not connected D)none ans d
10) Find out output? using system.data.ADO
class mydb
{ public static void main( )
{
try {
ADOConnection ac=ADOConnection(“Data source=MIT”);
Ac.open();
ADOCommand z=new ADOCommand(“create table emp(empno integer,ename char[20]”,x);
z.ExecuteNonQuery();
Console.writeline(“table created”) }
catch(System.Exception e) {
Console.writeline(“error”); } } }
A)Exception raising B)Table created
C)record source not specifying D)none ans d.