C# - ver 1
What of the following are correct for creating a connection object to database named MyDB?
("Data Source=myserver;
The extension of an assembly is _________
.dll
What is the correct syntax for comment entries in C#
/* */
Console.WriteLine(i);
0
DataTabledt = new DataTableO; Console.WriteLine(dtColumns.Count);
0
int i=Array.IndexOf(Array1,3);
0
int[] Array1= {3,2,1};
0
For decimal, the default value is
0.0m.
case 1:System.Console.Write ("{0}",1);goto default;case 0:System.Console.Write ("{0}",0);goto case 1;
010
How many Page directives an ASP.NET page can include?
1
What are building blocks of an XML Web service
A discovery service, a description service and a transport protocol.
Which sentence is correct
A web server is a software product in charge of hosting your web applications
11. Which sentence about Connection object is correct
A. Connection object is used to establish a session with the data source
What of the folllowings is correct if we want to set the AChild form as a child form of the parent form named TheParent
AChild.MdiChild = TheParent
Any class that contain one or more abstract methods must be declared as
Abstract
Which of the following statements are true with respect to abstract functions?
Abstract event declarations are only permitted in abstract classes
public unsafe struct Node { public int Value; public Node* Left; public Node* Right; }
Nothing is wrong with the above code.
ADO.NET provides features for accessing traditional databases like SQL Server as well as databases, which are accessed using
ODBC,OLEDB
ADO.Net.Provider features for accessing traditional database like SQL Server as well as databases , which are accessed using
OLEDB + XML
C# provides an Unified Type System, which means that all data types are derived from __________ class
Object
The _______class is the ultimate base class for all data types.
Object
To get values of the columns of the i-th row in a DataTable object named datatable. what of the followings is correct?
Object Q array = datatable.Rows[i].ltemArray;
Which of the following methods can act as a constructor for the class "Object" that is used to create an object?
Object(){}
Which of the following statements best illustrates the use of the Reflection API.
Obtains Class and Type Information from an Assembly Obtains Member Information from a Class Dynamically Invokes Methods from Classes in an Assembly
When a Data Form is created using the Data Form Wizard, which of the following classes are used by default
OleDbDataReader,OleDbConnection,OleDbCommand
How many web.config files an ASP.NET application can have?
Only 1.
________ allows developers and business analysts work together to define and modify business processes shared between applications.
Orchestration
Human h = new Human(); h.Name = "Nguyen Van A"; Console.WriteLine(h.Name);
Output of this code is "Nguyen Van A".
Which of the following statements are true with respect to overloading?
Overloading of methods permits a struct, or interface to declare multiple methods with the same name, provided the signatures of the methods are all unique.
The first event to be triggered in an aspx page is
Page_Init
The ____control groups a set of controls within a non-labeled an scrollable frame
Panel
At least one _______ constructor must be declared to suppress the automatic generation of a default constructor.
Parameterized
_______ service allows users to handle their own rules for handling
Personalization
____property is used to get or set the shortcut menu associated with the control
PopUpMenu
In below events of page, which one is raised first
Prelnit
____ are the Print support controls provided by WinForms
PrintPreviewControl,PrintDocument
IntelliSence pops up a list of _____that can be called on an objec
Properties
The____ event of the PrintDocument class is triggered immediately before each PrintPage event ocurs
QueryPageSettings
The...method of the ...object is used to redirect the user to another page.
Redirect, Response
The information about a class can be found out using ________
Reflection
Assume you wish to check validation of E-mail data. Which validation control is the most suitable to do it?
RegularExpressionValidator
The .NET platform is built on the following features of the Windows 2000 server family.(Select all that apply)
Reliability Security Manageability
The view types supported in Winforms are
Report view
What is result of the following SQL command
Return records that have StudentNo, LastName, FirstName from Students table and ClassName from Classes table
Which of the following objects can we use to read data from a Micorosoft SQL Server 2000 database?
SQLDataAdapter,OleDbDataAdapter,ADORecordSet
public class Q21 {int maxElements;void Q21() {maxElements = 100;System.out.println(maxElements);}
Compilation error at line 3.
void show() {System.Console.WriteLine("non-static method in Test"); static override void show() {
Compilation error at line 7.
System.Console.WriteLine("Number 1 is 1");
Compile error
System.Console.WriteLine("Number 1 is 2");
Compile error
public void SayHello(string yourName);
Compile error
Assume that Sub1 and Sub2 are both subclasses of class Super.
Compiles and definitely legal at runtime
A custom control should you use to verify an authorized aplication user called as _____
Complex Control
public abstract void SayHello(string yourName) { System.Console.WriteLine("Hello {0}". yourName):
Complieerror
Which sentence about Connection object is correct?
Connection object is used to establish a session with the data source.
____property of a connection object is used to get or set the string used to open a database
ConnectionString
The WriteLine method is a part of the ______ class
Console
Basic input and output operations are performed in C# using the methods of the ______ class in the _________namespace
Console,System
Basic input and output operations are performed in C# using the methods of the ______ class in the _________namespace.
Console,System
Which class represents shortcut menus that can be displayed when the user clicks the right mouse button over a control or area of the form?
ContextMenu
which class is the base class for all the controls that can be used in Windows Forms?
Control
ADO.NET provides a single set of types that communicate with multiple database management systems (DBMSs)
F
All interface members are implicitly private
F
An abstract class is a class that can be sealed
F
An abstract class is a class that cannot be inherited from
F
An assembly is a logical compile-time mechanism
F
Because the Thread pool are always background threads
F
Because the Thread pool are always thread with default priority
F
Elements of an ArrayList variable can have different types
F
Executable assemblies (*.exe) can be installed into the GAC
F
If maximize and minimize buttons are displayed then the HelpButton property is ignored
F
Interfaces can be used to define state data
F
Interfaces can provide an implementation of the methods
F
Like a non-abstract class, an abstract class must provide implementations of all members of the interfaces that are listed in the base class lis
F
Namespace are runtime entities
F
Namespace is a physical run-time mechanism
F
Object graph have to map to classic OO relationships
F
Object graph isgraph of serialized object
F
Oracle.NET Framework Data Provider
F
Override base method can be defined by virtual keyword only
F
Override method can change accessibility of overridden base method
F
Override method does not include override keyword
F
Panel controls are not visible at runtime
F
Panel controls cannot contain other controls
F
Panel controls cannot support scroll bars
F
Performance of single-file model is better than of multi-file model
F
Performance of single-file model is less than of multi-file model
F
Performance of single-file model is the same as of multi-file model
F
Private assemblies are deployed to GAC
F
SQL.NET Framework Data Provider
F
Shared assemblies are libraries reside in the same directory of application making use of them
F
The method on which a delegate makes calls cannot have any arguments
F
The method on which a delegate makes calls cannot have return type
F
The value of the HelpButton property is ignored if the maximize of minimize boxes are shown.
F
Type of a List<T> variable is value type only
F
You cannot determine total elements of a List<T> variable
F
You cannot determine total elements of an ArrayList variable
F
You must specify total elements of a List<T> variable before declaring it
F
You must specify total elements of an ArrayList variable before declaring it
F
[C] A temporary cookie is saved to the user's hard drive
F
[D] A temporary cookie is not destroyed after the user logs off your site
F
a given application domain can have only thread executing with it at any given time
F
.NET is a whole new platform centered around the Intranet
False
A C# program can have only one using directive
False
A DataSet object is one of the components of the data provider.
False
A property can be a static member, whereas an indexer is always an instance member.
False
An assembly cannot be used in more than one application at a time
False
An indexer that includes the override modifier may also include the sealed modifier
False
An instance of a delegate type encapsulates one or more callable entities.
False
DataView represents one table from DataSet that exists in the memory
False
Delegate can be removed from another type using the delete operator.
False
Delegates can be combined using the concatenation operators
False
Indexers can have user-defined names.
False
Indexers should be used only in situations where the abstraction makes sense.
False
It is possible to access members of the System.Delegate type via the usual member access syntax.
False
Manual memory management needs to be done in C#
False
Private assemblies have no versioning policy.
False
System.Delegate is an interface type that all delegate types derives.
False
The abstract modifier can be used on indexers but not the modifier override.
False
The default value of AutoEventWireUp is FALSE
False
The new modifier applied on delegates hides inherited member by the same name.
False
The new modifier is only permitted on delegates declared within another type
False
Which of the following are true with respect to delegates? //MSDN
For static methods, a callable entity consists of just a method. Delegate types are implicitly sealed It is not permissible to derive any type from a delegate type.
___is the easiest way to allow the user to interact with the application
Form
What is method of form to transmit the form data back to web server for processing
Get,post
When we want to associate a key with values which of the following classes are preferred?
Hashtable
IntelliSence pops up a list of ___ that can be called on an onject
Hints + Properties
What are required services in an ASP.NET Web server?
IIS Admin and World Wide Web Publishing
What is the output format of the file the C# compiler produces
IL
An assembly consists of Assembly Metadata. Type Metadata. _ and
IL Code and Resources
Superclass a = new Superclass();Subclass1 b = new Subclass1();
Illegal at compile time
Which file is the manifest information located in?
In lib.dll
What is the name of entity that compiles CIL code into meaningful CPU instructions
Just-in-time (JIT) compiler
Arrange the sequence in which the key events are triggered
KeyDown, KeyUp, KeyPress
class Parent { } class DerivedOne :Parent { } class DerivedTwo :Parent { }
Legal at compile and runtime
The ____ property of the LinkLabel control is used to specity the text, which has to be displayed as a link.
LinkArea
The types of list box supported in Winforms are
ListBox
What control support us to display the list items in different types as text only, text with small icons, text with large icons and report views?
ListView
The ____ event of the Form control is used to perform tasks such as allocating resources used by the form
Load
What is the first event is raised when the form has been allocated on the managed heap
Load
Animal a = new Mammal(); a.DisplayO:
Mammal
C# code can be classified into types:
Managed code Unmanaged code
What is the role of the CLR (Select all that apply)
Manages memory Compile once and run on any CPU & OS that supports the runtime.
Which is internal access modifier
Marks a member as accessible limited to the current assembly, but not outside the assembly
The ____feature of Windows Installer provider a standard method for distributing components and ensures that the installed component is of the correct version
Merge Modules
What kind of memory where an object is allocated?
Stack area
Which of the following statements are true with respect to Static constructors.
Static constructors cannot take parameters. Static constructors cannot be called explicitly.
Console.ReadLine() returns the input as a ________
String
Which sentence about strong name is correct
Strong name is used to uniquely identify the publisher of a .NET library
Which of the following are value types?
Struct Union
Which of the following can be defined as generic?
Structures,Delegates,Methods.Classes.Interfaces
The ________namespace contains all code required to interact with the including the console output
System
The _______ namespace provides the classes and methods for manipulating arrays
System.Array
The Syntax of a predefined Sort method is:
System.Array.Sort(Arraytosort)
A delegate is a class derived from _________
System.Delegate
GDI + resides in _____ assembly
System.Drawing
The Pen class belongs to the ____namespace and cannot be inherited
System.Drawing
Which class is at the top of.NET class hierarchy?
System.Object
namespace contains classes useful for synchronization
System.Thread
Which delegate of System.Threading namespace points to any methods that take no argument and returns int?
System.Threading namespace does not contain this delegate.
Which namespace is VS.NET contains classes that help in constructing and sending emails?
System.Web.Mail
To declare a web service the class must inherit from __________
System.Web.Service
Which namespace does the class ListView belong to
System.Windows.Forms
'Class.getNumber()' must declare a body because it is not marked abstract
T
A set of services for creating and exposing the classes
T
A set of specifications defining the programming protocol
T
ADO.NET supports multiple data providers, each of which is optimized to interact with a specific DBMS
T
ASP.NET supports single-file model only
T
An array is a data structure that contains a number of variables, which are accessed through computed indices
T
An explicit interface member implementations are permitted to call abstract methods
T
An overriding event declaration must specify the exact same accessibility modifiers, type, and name as the inherited event
T
At run-time, a value of an array type is null or a reference to an instance of that array type
T
Dataset store its data inXML
T
FF()
T
False, True
T
Form-Level Validation
T
Implement the methods getNumber(),getHeight(), getWidth() in the class ClassB
T
Link Label is a commands control
T
Microsoft Windows Installer is shipped alog with Windows 2000, windows ME and Windows XP as an installtion and configuration sevice
T
ODBC.NET Framework Data Provider
T
OLEDB.NET Framework Data Provider
T
Object graph is a set of related object of serialized object
T
Panel controls are used to group related controls in a logical unit
T
The "using" alias directives can be used to pull out and bring into scope one component from a namespace.
T
The System.Array type is the abstract base type of all array types
T
The code will compile successfully and output will be Programming In c#
T
The code will compile successfully and outputs will be: 1 2
T
The expression of a lock statement must denote a value of a reference-type
T
The instance properties and methods are those, which are common to all the instances of the class
T
The members of an array are the members inherited from class System.Array
T
The output of the code will be: 1000 1000
T
The output of the code will be: 321123
T
The shared properties and methods are those, which are specific to a particular instance
T
The term packaging imliesbunding up all the files in the application into a single file called a Distribution Until
T
Using directives are provided to facilitate the use of namespace
T
Without explicitly reimplementing, a derived class can alter the interface mappings it inherits from its base
T
[B] * A persistent cookie is not destroyed after the user logs off your site
T
an explicit interface member implementations can be abstract
T
the code will generate a compilation error, as parent class does not have a display method with one argument
T
the lock keyword marks a statement block as a critical section
T
The .NET platform is built on Internet Protocols such as _______ and _______
TCP /IP HTTP
DataSet is a logical representation of data that supplies information without taking into consideration the data source
TRUE
The code compiles and "5, Sub" is printed on the standard output.
TRUE
Which of the following is a legal constructor for the class Test.
Test() { } public Test(int a, int b){} Test(int a, int b){}
What is the output of the following code? Test t2 = new Test(2);static Test t3 = new Test(3);public static void Main(){Q12 Q = new Q12();
Test(1) Test(3) Test(2)
Brushes can be created using one of the following classe
TextureBrush,SolidBrush,LinearGradientBrush
Where can you change 'Default Namespace" of Visual Studio?
The Application tab of the project's Properties window
A catch clause may catch exception of which type?
The Exception Type.
What is the TrackBar control?
The TrackBar control allows user to select a value from a range (of values), using scroll bar-like input mechanism.
What is the base keyword?
The base keyword is used to access members of a base class from within a derived class.
public static void Main(){int num3=3;Console.WriteLine(num1+num2+num3r);
The code does not compile because static method cannot access nonstatic variables Var1 and var2.
using Outer.Inner; class SpecialWibble: Inner.Wibble { }
The code generates a compile time error the code will compile successfully as the using-namespace-directive does not bring the name Inner itself into scope.
case 'a': Console.WriteLine("A");break;default: Console.WriteLine("Default");
The code will compile and run and the letter "A" will be written to the standard output.
Delegate d = new Delegate(Foo); Question t=new Question(); t.MultiCall(d,3);
The code will compile successfully and display following lines on the standard output: Hello Hello Hello
MyDelegate mdg = new MyDelegate(MyFunction);TestDelegateClass tdc = new TestDelegateClass();System.Console.WriteLine(mdg(new
The code will compile successfully and output of the code will False
CAmerican chuck = new CAmerican();CBrit edward = new CBrit();Stereotype[] stereotypes = new Stereotype[2];stereotypes[0] = new Stereotype( chuck.BePatriotic );stereotypes[1] = new Stereotype( edward.BeXenophobic );
The code will compile successfully and output of the code will be: America Hello
System.Console.WriteLine("In Try");return;
The code will compile successfully and output the following text: In Try In Finally
get {if(i >= 0 && i < Message.Length)return Message.Substring(i,1);else return "";
The code will compile successfully and output will be: WELCOME
public static Employee getEmpId(int EmpId){
The code will compile successfully and outputs will be: 1 2
static void Main() {SimpleDelegate d = new SimpleDelegate(F);d();
The code will compile successfully and the output of above code will be: Test.F
Indexing Index1 = new Indexing();[2.5]Index1["CA"] = "CALIFORNIA";Index1["AM"] = "AMERICA";System.Console.WriteLine(Index1["AMERICA"]);
The code will compile successfully but does not display any output.
int @Main;int[] Static= new int[3];@Main =100*Static[1]; Console.WriteLine(@Main);
The code will display
Which of the following sentences are true about Constructors?
The constructor must have the same name as that of the name of its class.
studentAdapter = new SqIDataAdapter (studentCommand): studentSet = new DataSetO; this.txtFirstName.DataBindings.Add ("Text". studentSet "FirstName");
The dataset has not been populated.
What does the keyword "virtual" declare for a method?
The method can be overridden.
public int i=20;public char ch='a';public float f1=10;public void GetFloat(){Console.WriteLine(f1);
The output of above code will be: No of members : 11 No of fields: 3
A objA=new A();Type t1 = objA.GetType();Console.WriteLine("The type of objA is : {0} ", t1);
The output of code will be: The type of objA is : Space1.A
case 2: Console.WriteLine("Two");break;case 1+a: Console.WriteLine("Two Two"); break;default: Console.WriteLine(j);
The output would be only the text "Two".
try{int p=10;Console.WriteLine("enter a number");int r=Int32.Parse(Console.ReadLine());p/=r;}
The try block throws an exception hence the control goes to catch block but line number 11 and 12 does not produce the same output.
if(x[var]>100) break; if(x[var]<0) continue; x[var+1]=x[var]+y[var];
There is nothing wrong with the statement.
for(i=0;j=0, i<10; ++i,j+=i){k+=i*j+j*j;}
There should be comma between i=0 and j=0. There should be a semicolon between j=0 and I<10.
Which member of System.Threading namespace is an enumeration?
ThreadPriority
The____ control is used to display text when the mouse points to a particular control
ToolTip
Which control is used to display a short, customized help message for individual controls on a form?
ToolTip
.NET is said to accelerate the next generation of the Internet
True
A DataSet constitutes a "disconnected" view of the data present in the database.
True
A delegate must define name of the method on which it makes calls
True
A get accessor of an indexer corresponds to a method with no parameters.
True
A namespace is a logical compile-time mechanism
True
A static constructor cannot have accessibility modifiers.
True
A static constructor is a member that implements the actions required to initialize a class.
True
Abstract class cannot be directly instantiated but it can be used to create object references
True
An indexer element can be classified as variable.
True
An interface is a pure abstract class.
True
An interface is name collection of semantically related abstract member
True
Assemblies can be shared by installing it in the global Assembly Cache.
True
Because methods are allowed to hide inherited methods, it is possible for a class to contain only one virtual method with the same signature
True
DataTable represents one table from DataSet that exists in the memory
True
Delegate types are implicitly sealed
True
Delegates help to call a method at runtime?
True
Elements of a List<T> variable cannot have different type
True
For a multi-cast delegate, the invocation list is formed by concatenating the invocation lists of the two operands of the addition operation that formed the multi-cast delegate.
True
For a non-multicast delegate instance, the invocation list consists of the delegate instance itself
True
For versioning the private assemblies, the CLR simply loads the newest assemblies found in the application directory.
True
If a class has a static constructor then it is automatically called when the class is loaded. Static constructors cannot be invoked explicitly.
True
In C# array elements are automatically assigned default values
True
In C#, an underscore is allowed as an initial character of a variable.
True
Indexers should have both a getter and setter, as arrays are read/write objects.
True
It is not permissible to derive a non-delegate class type from System.Delegate.
True
Item stored in ViewState exist for the life of the current page?
True
Microsoft .NET allows developers to develop applications using different languages, which run on the Unix platform
True
Necessary memory allocations used by a running application
True
Once instantiated, delegate instances always refers to the same target object and method
True
Override method and overridden base method must have the same return type
True
Private assemblies are stored in the same folder as that of an application.
True
Properties provide the opportunity to protect a field in a class by reading and writing to it using accessors
True
Reflection APIs does not allow creating of assembly in memory dynamically.
True
Set of resource, such as external code libraries and the primary thread
True
Shared assemblies are libraries intended to be consumed by numerous application on a single machine
True
Stack is a first-in, first-out queue
True
Subscribing an object to an event depends on whether the event exists or not.
True
The Reflection API allows creating types on the fly and invoking methods on them.
True
The Thread pool manages thread efficiently by minimizing the number of threads that must be created, started and stopped
True
The new modifier applied on delegate overrides the method for which the delegate is being used.
True
The object invokes the default constructor when no parameters were passed to it.
True
The object that notifies the other objects, about events is known as the publisher.
True
The overridden indexer must differ from the signatures of all other indexers declared in the same class
True
The public keyword can be ignored for the Main function in C#.
True
The sealed modifiers are not permitted in an enum declaration.
True
Value types can be null
True
When an MDI parent form is closed, the Closing event of all MDI child forms are raised before the MDI parent form's Closing event is raised
True
When compiler compiles the statement above, it internally generates DelegateName class.
True
When the compiler compiles the statement above, it internally generates a new class type.
True
When using Thread pool, we can focus on our business problem rather than the application's threading infrastructure
True
int x=0,y=4,z=5;if(x<2)if(y<4){Console.WriteLine("One");
Two
Which method is fired lastly during the page load?
UnLoad()
__________is all about converting a reference type into a value type.
Unboxing
When a class is used inside its namespace, the _______ of that class is used
Unqualified name
What is state of a thread after creating a Thread object?
Unstarted
how do we create a control to enter password
Use TextBox control with PasswordChar property is set a value
Assume you wish show data of Customers table in a DataGridView control. What is the best manner to do it?
Use the Disconnected Layer
Namespaces are defined using _____ statements.
Using
What is NOT a client-site technology?
VB.NET
What are client-side script languages
VBScript and JavaScript
____property is used to get or set the object that contains data about the control
Value
In C# datatypes are divided into two fundamental categories
Value types and reference types
Which sentence about ViewState is correct
Values of each GUI widget on the page are stored in a hidden form field.
____are the visual effects supported in WinForms (Choose all correct answers)
Visual Inheritance,Control Anchoring,Cotrol Docking,Transparent Forms
Microsoft .NET is primarily made up of the following three components.
Visual Studio .NET 3rd party .NET services .NET platform itself
Which sentence about WSDL is correct?
WSDL is used to describe information about the web service
public static void Main(){try{System.Console.WriteLine("hello");
We cannot have a try block without a catch or/and finally block
Which of the following statements are true with respect to destructors?
When an instance is destructed, the destructors in an inheritance chain are called in order, from most derived to least derived.
When will the garbage collector run?
When the application is low on memory
Which of the following are valid identifiers?
_void @void _var
For multiple levels of organizations ___ can be used
a nested namespaces
A __ can be thought as a mould of a class
abstract class
Which of following extension does a Web service file will have?
asmx
The markup file is saved with the extension ____ and it stores the markup code used to design Web pages
aspx
Which statements on the <<< call >>> line are valid expressions?
b.m2(); i=b.x; i=b.y;
Which of the following will execute without errors at compile time.
class Object{static void Main(){}}
Identify the correct syntax for creating an executable file referencing an assembly.
csc /out:< executable name > /target:exe /r:<assembly name1;assemblyname2...;> <filename1 filename2..>
Identify the correct syntax for creating an executable file.
csc /out:< executable name >/target:exe<filename1 filename2..>
The syntax to create an assembly file is:
csc /out:<assembly name>/target:library <filename1 filename2..>
Which of the following commands can be used to create assembly named "myAssembly" from the files "file1.cs and file2.cs"?
csc /out:myAssembly.dll /target:library file1.cs file2.cs
Value types differ from reference types as___
data can be stored using value types but not in the reference type. Variables of the value types directly contain their data, whereas variables of the reference types store references to objects.
for(int i=0;i<2;i++){for(int j=0;j<3;j++){ if(i==j) continue;}Console.WriteLine("i={0} j={1}",i,j);}
i=1 j=0 i=0 j=1 i=0 j=2
StreamWritersw = new StreamWriter("Text.txt")
if file "Text.txt" does not exist, this code will create a new file
The global assemblies are saved in the _________
in the <drive>:\WINNT\Assembly folder.
Which of the following is a legal loop construction?
int j=0; for(int k=0;j+k!=10;j++,k++){Console.WriteLine("j= {0} k={1}",j,k);} |
System namespace is used in the C# programs to:
interact with the system environment
Which event of form handles pressing a key
keydown
Which of the following is the correct syntax for declaring an indexer.
protected int this[int var1]
To create an instance of the Font class using existing Font and FontStyle, the constructor is:
public Font(string fontname, float size);
Which of the following are correct statements for implementing an abstract class
public abstract class ClassA
Assume that you wish to build a delegate that can point to any method that returns a bool value and takes a string as input parameter. What is correct syntax to declare this delegate?
public delegate boolMethodl(string si) ;
Which of the following is a correct event that is based on the delegate named " MyDelegate"
public event MyDelegate MyEvent;
Access Modifiers for variables in C# can be the following (Select all that apply)
public private protected
What can be signature of an application's entry point?
public static void Main() { }
Which of the following is a valid method declaration?
public virtual void Display(){}
Which of the following methods can be called as an "operation"? //'ClassA.methodA()' : virtual or abstract members cannot be private
public void methodA();
C# is a ____________language.
purely Object-Oriented
Abstract methods holds only
return type,name of method ,Parameters
For defining the delegate which of the following entities must be specified?
return types of each method parameters used by each method
Return type of indexers is
same as return type of get method of a property.
The ______ method is used to assign some value to a data member in a class.
set
The programmer has an assembly named pri.dll which other programmer also wants used the same assembly
sn -k key1.snk csc /out:pri.dll /target:library file2.cs /a .keyfile:key.snk gautil -I pri.dll
A key pair is created using the _______utility.
sn.exe
What is SoapFormatter
soapFormatter is a serialization formatter that represents graph as a SOAP message
Methods can be overloaded in C# by:
specifying different number of parameters specifying different types of parameters
Which keyword is used when you wish to explicitly reference the fields and members of the current object?
this
Which of the following statement with respect to Data Grid control are True? (Choose all correct answers)
to a single column based on the DataSource-optionally supports data editing.
Data reader represents a read-only, forward-only cursor
true
SessionID values are stored in a cookie
true
a single process may contain multiple application domains
true
class Program { static void MainO{ try Console.WriteLine("try"); catch Console.WriteLine("catch");
try finally
_____ keyword is used to import the classes of the namespace
using
For using SQL .NET Data Provider what using statement of the following is correct
using System.Data.SqlClient;
For using SQL.NET Data Provider what using statement of the following is correct?
using System.Data.SqlClient;
Does destructor of a class impact to garbage collection
yes
can we add a control at runtime
yes
Which of the following methods can be used as a destructor for a class "myClass".
~myClass() { }
Select the core .NET Enterprise Servers
Commerce Server 2000 Exchange 2000 Server
A persistent cookie exists only within the HTTP header
F
A serialized object always has an Object graph
F
A set of graphical symbol for modeling the objects
F
IndexerTest IndexMe = new IndexerTest();IndexMe[1] = 100;IndexMe[2] = 1000;
100 1000 1000
How many times the .NET programs are compiled
2
intx = 2009: inty = 2010; System.Console.WriteLine ("The value of x & y is : {0}". (x & y));
2008
1.Subscribe object 2.Notify subscriber 3.Define an event
3, 1, 2
1.Place the assembly in the global assembly cache.2.Sign the assembly with the key pair.3.Create a key pair.
3,2,1
Console.WriteLine(m1.Var1+m1.Var2+LocalVar);
4
if(i%3==0) throw new Exception("Exception1"); Console.WriteLine(i);
4 5
try{if(i%3==0) throw new Exception("E0");try{if(i%3==1) throw new Exception("E1");Console.WriteLine(i);
5 8
int var1,var2;for(var1=0,var2=0;var1+var2<20;++var1,var2+=1)
8
Which of the following are attributes of the @Page directive that is used to implement Code-behind files
<%@ Page <attribute>="<value>" %>
Version number of an assembly are stored in the following format:
<Major version>.< Minor version >.<Revision>.<Build Number>
Console.WriteLine("<3");else if (myVar>2)Console.WriteLine(">2");else Console.WriteLine("Other");
>2
The prefix ______ enables the use of keywords as identifiers, which is useful when interfacing with other programming languages.
@
Which sentence about DataSet is correct
A DataSet is an in-memory representation of external data
Which of the following statements are true with respect to Static constructors?
A class has no other constructors than those that are actually declared in the class Constructors are not inherited
An engine that shared by all .NET-aware languages is called:
A common runtime engine
Which of the following statements are true about delegates
A delegate can be thought of as a type-safe object-oriented function pointer It cannot be used for event handling. It can handle only one method at a time.
Within the namespace we can declare following:
All the options mentioned
The___event of the Form control is used to perform tasks such as allocating resources used by the form
Allocate
The beta.cs file contains a class called Beta that also contains an internal method called Method. Can Alpha.Method be called from Beta.Method and vice versa?
Alpha.Method and Beta.Method can call each other only if Alpha and Beta are located in the same assembly.
The _____ package forms the basic unit of versioning.
An Assembly
________ is a unit of class deployment.
An Assembly
_______ is a member that enables an object or class to provide notifications.
An Event
Which of the following statements are true with respect to an Array type
An implicit reference conversion exists from any array type to System.Array
Which of the statements on Serializable is true?
An instance of a type that is Serializable can be easily transmitted over the network, or stored in a file on the file system
What is return value of ExecuteNonQueryO method of a Command object?
An integer is number of affected rows.
_____property is used to get or set the edges of the control are anchored to the edges of its container
Anchor
Which variables can use by all users and in all pages?
Application
To preserve screen space on the monitor, VS.NET provides us with
Command Window,SEW,AHW,Properties Window
which sentence about background threads is correct?
Background threads are viewed by the CLR as expendable paths of execution that can be ignored at any point
Which sentence about background threads is correct
Background threads are viewed by the CLR as expendable paths of execution that can be ignored at any point in time
The library provides shelter from the complexities of raw API calls and offers a consistent object model used by all .NET-aware languages
Base class
We can use ... and ... methods to ensure that application-level variables are not updated by more than one user simultaneously.
Block and Unblock
What mode is VS.NET allow you create a portable exe(EXE) file?
Both Debug Mode and Release Mode
__________in simple terms is nothing but conversion of a value type into a reference type.
Boxing
what is boxing
Boxing is conversion form an object to a value type
How can we create the object dynamically in C#?
By using the System.Activator .CreateInstance() method to create an instance of object in the following manner. Type myObjectType =Type.GetTypeFromProgID("MyDll.MyOName") object myObject = System.Activator.CreatInstance(myObjectType)
____control combines the features of the TextBox and the ListBox controls
ComboBox
C# is considered as a modern replacement for the language/s like (Choose all that apply)
C C++
Under which of the following environments does your programs execution code run
CLR
Select the service, which allows users to maintain their schedules thus facilitating timely and manageable interactions with other users.
Calendar
Core Microsoft .NET building block services
Calendar Dynamic delivery Notification
A delegate instance encapsulates one or more methods, each of which is referred to as a _________
Callable entity //MSDN
You want to add a control to your form that allows you to set a particular option on or off. Which control would you choose?
CheckBox
What are states that a CheckBox can have
Checked only
If Parent is a base class and Child is its derived class then which of the following statements is not valid?
Child c1=new Parent();
Presents a logical view of our work using an Explorer-like view of the classes, methods and properties
Class View
____are the collection of reusable classes or types
Class libraries
are the collection of reusable classes or types
Class libraries
To perform a change to a table using the Command object named Cmd, what statement of the following correct?
Cmd.ExecuteNonQuery()
To perform a change to a table using the Command object named Cmd, what statement of the following is correct
Cmd.ExecuteNonQuery()
namespace College.Library{
College.Library.Shelf. Book()
The DataTable structure is defined by its _ and _.
Columns. Constraints
A set of theorems which must be proven for checking the correctness of the object model
F
12. Which is return value of ExecuteNonQuery() method of a Command object
D. An integer is number of affected rows
The _____ component is used to fetch the values from the data source to the DataSet and also to update the data source with the DataSet data
DataAdapter
What is component is used to fetch the values from the data source to DataSet and also update the data source with data in the DataSet
DataAdapter
What is component is used to fetch the values from the data source to DataSet and also update the data source with data in the DataSet?
DataAdapter
To get values of the colums of the i-th row in a DataTable object named datatable, what of the followings is correct?
DataRow array = datatable. Rows[i].ItemArray;
To get values of the columns of the i-th row in a DataTable object named datatable, what of the follwings is correct?
DataRow array = datatable.Rows[i].ItemArray;
Which of the following statements are True with respect to DataSet in ADO.Net? (Choose 2)
DataSet is an in-memory cache of records that can be visited/modified in any direction.
The____property of a DataGrid control, allow filling various kinds of data in a DataGrid including data from a DataSet, DataViewManager, Arrays, Lists etc
DataSource
Assume you wish show data of Customers table in a DataGridView control. What is the most suitable object to set to the DataSource property?
DataTable
Which class is used to insert, remove, evaluate and manipulate the values in a table of one DataSet
DataTable
The syntax for declaring array is
DataType[] arrayname;
What is the lifespan for items stored in ViewState?
Exists for the Life of the current page
What mode is VS.NET allow you to step through each line of code and trace the execution of your application
Debug Mode
How do we implement encapsulation
Define a pair of accessor and mulator methods.Define a named property
What are properties of [WebService] attribute
Description. Name and Namespace.
class Test {static void Main() {Question Dir = new Question();// Add code here. . . . . . . .}}
Dir ["S"]="SMITH"; Dir ["M"]="MARTIN";
What is spin control
DomainUpDown,numericUpDown
The method can be used to draw a rectangle or a square depending on the coordinates passed as its argument
DrawRetangle
Which of the following methods can act as a constructor for the class "Employee" that is used to create an object?
Employee (){}
static void Main(string[] args) {IntIndexer myInd = new IntIndexer(5);myInd[1] = "Some Value";myInd[4] = "Any Value";myInd[2] = "Another Value";Console.WriteLine("\nIndexer Output\n");[2.5]for (int i=0; i < 5; i++) {Console.WriteLine("myInd[{0}]: {1}", i, myInd[i]);
Empty Some Value Another Value Empty Any Value
Which sentence about enumerations is correct?
Enumerations are a handy programming construct that allow you to group name/value pairs
The type of event declaration must be of _________ type.
Event
_____is any action directed at the application
Event
When we need to retrieve only a single value from the Database,which Method is efficient
ExecuteScalar()
A class is the implementation of an objec t
F
class Test{ static void Main() { A.F(); B.F(); } }
Init A A.F Init B B.F
The ______ declares a reference type that has abstract member only.
Interface
Which of the following statements correctly differentiates between delegate and an interface?
Interface cannot be instantiated but delegates can be instantiated. In an interface the method name is fixed, whereas with a delegate only the signature is fixed.
A program in .NET is first compiled by the language specific compiler into __
Intermediate Language
What is default accessibility for the structures in C£?
Internal
What are thee steps involved involved in calling one from another form
Invoke Show
Which of the following properties does the Type class have?
IsCLass
The ____property of the Form control is used to determine whether there are any MDI child forms open in your MDI application.
IsMdiChild
When the property _____ is set to True for a Windows form, it becomes a MDI form
IsMdiContainer
What does the "EnableViewState" property do?
It allows the page to save the users input on a form across postbacks.
Which of the following statements are true about the Reflection API?
It can at times even be used to emit Intermediate Language code on the fly so that the generated code can be executed directly.
Which of the following statements are true about the Reflection API?
It can be used to effectively find all the types in an assembly and/or dynamically invoke methods in an assembly.
Which of the following are true about the finally clause of try-catch-finally statements?
It is always executed unless its thread terminates
What is advantage of code-behind page model?
It is possible to have designers working on the markup while programmers author the C# code.
What is managed code
It is the code targeting the .NET runtime.
Which of the following must be true for the object thrown by a throw statement
It must be assignable to the Exception type.
Whe n is the garbage collector invoked?
It s invoked when the stack does not have sufficient memory to allocate a requested object
for(i=0,,j=0; ++i,j+=i; i<10,++i;)k+=i*j+j*j;
It uses more than one loop index.
Assume that a method named DataLoad is defined to makes a list of suppliers available by returning an ICollection interface. A Web page has a ListBox control named IbCustomers
Miss calling the DataBind() method of the page.
What are the types of Dialog boxes?(choose all correct answers)
Modeless dialog boxes,Modal dialog boxes
Which type of the System. Threading namespace can be used to resolve the issue of concurrency?
Monitor
Assuming that I have several clients who would like to receive notification when a particular event occurs. Putting all of them in a ______ type of delegate can help call all the clients when a particular event occurs.
Multi Cast delegate.
The unique feature of .NET is the ___________support that it provides
Multi-language
[WebService(Namespace = "http://tempuri.org/", Name-'My Webservice")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
My Webservice
What is a third-party data provider
Mysql
.NET Framework has two main components, are
NET Framework class library , Common Language Runtime
Microsoft .Net was formerly known as __________
NGWS (Next Generation Windows Services)
By default can we delete a folder that contains subdirectories and files?
NO
Which information is included in a connection string
Name of machine, name of the database on that machine, required security settings and other data provider-specific information
System.Windows.Forms is an important____of the class libraries in .NET framework?
Namespace
Classes in the Base Class Library are categorized into ______ based on their functionality
Namespaces
A C# class can be inherited from multi other classes
No
We CANNOT use methods that have some arguments for a delegate?
No
public class SubClass : SuperClass {SubClass(string s) { }public static void Main(){SuperClass s = new SubClass( "The" );
No constructor matching SuperClass() found in class SuperClass
C# language offers the following features
No pointers required: Automatic memory management through garbage collection!
The ___ is also referred to as a transient coockie
Session
In ASP.NET application, and ________ variables can be accessed by all the pages in the application.
Session, Application
Two types of delegates are:
Single Cast delegate
You are required to build an application that can serialize an object to a file. Then, this file can be transferre
SoapFormatter
To preserve screen space on the monitor , VS.NET provides us with
SolutionExplorer Window + Tabbed Windows + Class View Window + Command Windows + Properties Window
Which thing is not included in a .NET PE file
Source code
namespace Space1{
Space1.Space2.MyCl ass()
You need to get access to a database that is stored on a server running Microsoft SQL Server 2000. Which data adapter would you use?
SqIDataAdapter
What of the followings is correct for creating a command object with the connection con
SqlCommand Cmd = new SqlCommand("Select * From Student",con);
A class has no other destructors than those that are actually declared in the class.
Which of the following statements are true with respect to destructors?
_____it the normal ouput type for a WinForm project
Windows Application
Which is the most suitable statement to fill the missing code (line 12), if you want to build an in-house XML Web service?
WsiProfiles.BasicProfile1_1, EmitConformanceClaims = false)]
public static int Y = A.X + 1;static void Main() { Console.WriteLine("X = {0}, Y = {1}", A.X, B.Y);
X=1, Y=2
Select the two core technologies on which the .NET platform is based.
XML Internet Protocols
Can the errors be displayed in a pop-up message box
Yes
Does DataTable class support a method that allows obtaining the data reader-like navigation scheme
Yes
Does Microsoft supply data provider for Oracle database
Yes
Does NET Framework support to monitor the modification of a given external file?
Yes
For testing and development does website have to be hosted under IIS
Yes
Server side code is excuted at the server side on IIS in ASP.NET framework, and client side code is executed on the browser.
Yes
The runtime will automatically assign a new session ID for user when he/she logs on to an ASP.NET web application
Yes
a class library that is written by C# can be used in any other .NET programming languag
Yes
can multiple versions of the name .NET assembly be installed on a single machine
Yes
can we draw a hexagonal with GDI+
Yes, by using DrawPolygon method of Graphics object
can we cancel closing a form
Yes, by using FormClosing event
Can we connect to SQL Server Database without using SqIConnection?
Yes. we can connect to SQL Server Database using OleDbConnection.
Which of the following is a valid variable in C#?
_Class @class Class
How can you initialize an array of three Boolean values?
bool[] b=new bool[3]; bool[] b={true,true,true};
What statement is used to completely abort the execution of a loop?
break
Which of the following statements are true with respect to try-catch block?
catch statement are examined in order in which they appear .
Which of the following is a valid statement to implement class B in the class A
class A:B
Which of the following is a correct statement to declare the class "MyClass"?
class MyClass
The constructor without parameters is called _________.
default constructor
which sentence about default context is correct
default context is used to group together .NET objects that have no specific or unique contextual needs
which sentence about default context is correct
default context is used to group together .NET objects that have no specific or unique contextual needs.
public static int Method42(inti)
delegate int Met42(inti);
return i*42;
delegate int Met42(inti);
The manifest contains data that ___
describes how the elements in assembly are related to each other. describes the other assemblies on which the elements of the assembly are dependent.
Clients can attach executable code for events by supplying
event subscribers
What will appear in the standard output if tryThis() throws a 000000000FormatException?
exception 2 finally
Unboxing requires an ___________cast.
explicit
A class can inherit from many abstract classes.
f
A class is the instantiation of an objec t
f
ADO.NET objects are all strongly typed.
f
An abstract class is not permitted to map interface onto abstract methods
f
An object is the implementation of a class.
f
In a virtual method invocation, the compile-time type of the instance for which the invocation takes place determines the actual method implementation to invoke
f
Platform independent
f
There is no Data validation mode in Winforms
f
in ADO.NET, the RecordSet is bound to the data source
f
/•Line 47 class DerivedClass: IFace2. IFacel. BaseClass { },/"Line 1*/ class ImplDerivedClass: IFace2. BaseClass. IFacel { }
line 1, 47
A constructor is a special type of a _______ in a class.
method
public class A:B,C,D{ }The above code represents ______
multiple interface
Which of the following statements correctly declares a namespace?
namespace Namespacename{ ----- ----}
The method that overrides a method in the base class must be prefixed with the ____ keyword.
new
Static constructor has _______ parameter/s.
no
Which parameter modifier marks a parameter as passed by value
none
List<int>arrayl = new List<int>0; breach (int n in arrayl ) System.Console.WriteLine(arrayl.ToStririgO):
nothing
interface intA: one, two,three
one, two, three must be interfaces.
Which of the following is a correct statement that defines a delegate?
private delegate int MyDelegate() ; public delegate void MyDelegate() ;
object[] objArray=new object[3];
successfully
By default the compiler opens _____assembly
system.dll
A class inherits all interface implementations provided by its base classes
t
Access.NET Framework Data Provider
t
An abstract class is a class that cannot be instantiated.
t
An object is the instantiation of a class.
t
Control-Level Validation
t
Field-Level Validation
t
For every virtual method inherited by or declared in a class, there exists a most derived mplementation of the method with respect to that class
t
Fully Language Independent
t
Provides Location Transparency(Distributed Architecture)
t
Supports version compatibility
t
System built on ADO.NET are intrinsically highly scaleable
t
The dimension lengths are not part of the type of the array, but rather are established when an instance of the array type is created at run-time.
t
When we use the DataSet object, ADO.NET is based on disconnected data access.
t
private abstract void getNumber();
the abstract member cannot be private
If there is a change in the major number or minor number of the version number it indicates that
the assembly is incompatible with previous versions of that assembly.
When the array is initialized at the same time they are created, the c# compiler determines the size of array using
the number of items in the initialization list,The number present in the square bracket next to the data type at the right hand side.
Which of the following statements is correct for a method, which is overriding the following method: public void add(int a) {...}Select the most appropriate answer
the overriding method must return void
A command builder is only able to autogenerate SQL commands for use by a data adapter, if
the single table has been attributed with a primary key, and the column(s) representing the primary key is accounted for in your SQL statement
_______ enables the possibility for a function to be polymorphic when it is overridden in one or more inherited classes.
virtual