|
Question 1.
does session use cookies?
Answer: yes, Session users cookies.
|
|
Question 2.
gkgk
Answer: There ain't no difference as both involve one's dick. :D
|
|
Question 3.
what is difference between primary key and foreign key?
Answer: A primary key is a column, or set of columns which uniquely identify a record. For example; Department table's primary key is the Dept number.
A foreign key is a column or set of columns in a table which have a corresponding relationship and a dependency on another table, specifically the dependency is on the primary key of a table.
|
|
Question 4.
difference betwwen abstract class and interface with some code
Answer: Interface :
1.Interface have only Signature.
2.All the Methods are Public , It doesn't have access Modifier Controls
3.It have used Multiple inheritence in the Object oriented Language.
Abstract Class:
1.Abstract Class have Method defination and Implementation
2.It have control the Access Modifiers
3.It does not allow multiple Inheritence
|
|
Question 5.
may i know wat is garrbage collection and how it can be implemented
|
|
Question 6.
what is cache
Answer: cache is small memory which is placed in between cpu and main memoryy
|
|
Question 7.
is any one tell me what is an interface?
Answer: interface is which as as mediator betwwen user system and software device
|
|
Question 8.
List all collection available in c#?
Answer: System.Collections.GenericsSystem.Collections
Comparer Comparer
Dictionary HashTable
List ArrayList
LinkedList
Queue Queue
SortedDictionary SortedList
SortedList
Stack Stack
ICollection ICollection
IComparable System.IComparable
IComparer
|
|
Question 9.
What are anonymous methods?
Answer: In versions of C# previous to 2.0, the only way to declare a delegate was to use named methods. C# 2.0 introduces anonymous methods.
Creating anonymous methods is essentially a way to pass a code block as a delegate parameter. For example:
// Create a delegate instance
delegate void Del(int x);
// Instantiate the delegate using an anonymous method
Del d = delegate(int k) { /* ... */ };
By using anonymous methods, you reduce the coding overhead in instantiating delegates by eliminating the need to create a separate method.
For example, specifying a code block in the place of a delegate can be useful in a situation when having to create a method might seem an unnecessary overhead.
|
|
Question 10.
What is Partial Class?
Answer: Partial classes give you the ability to split a single class into more than one source code (.cs) file.
|
|
Question 11.
What is 'Auto Implemented Properties' in C# 3.0
Answer: In c# 3.0 you need not write code to create get and set properties, following code :
public class Person
{
int _id;
string _firstName, _lastName;
public int ID
{
get{return _id;}
set{_id = value;}
}
public string FirstName
{
get{return _firstName;}
set{_firstName = value;}
}
public string LastName
{
get{return _lastName;}
set{_lastName = value;}
}
)
can be written as :
public class Person
{
public int ID { get; set; }
public string FirstName {get; set; }
public string LastName {get; set; }
}
|
|
Question 12.
What are Anonymous Types in C# 3.0
Answer: In c# 3.0 you can create an instance of a class without having to write code for the class beforehand. So, you now can write code as shown below:
new {city="Queens", state="NY", country="US"}
Behind the scenes, the C# compiler would create a class that looks as follows:
class __Anonymous123
{
private string _city = "Queens";
private string _state = "NY";
private int _country = "US";
public string city {get { return _city; } set { _city = value; }}
public string state {get { return _state; } set { _state= value; }}
public string country {get { return _country; } set { _country = value; }}
}
|
|
Question 13.
What is Implicitly Typed Local Variables in C# 3.0?
Answer: C# 3.0 introduces a new keyword called "var".
Var allows you to declare a new variable, whose type is implicitly inferred
from the expression used to initialize the variable.
In other words, the following is valid syntax in C# 3.0:
var i = 1;
|
|
Question 14.
How do you inherit from a class in C#?
Answer: to inherit a class we can use abstract classes, in which we have to instantiate the method into abstract class since abstract functions do not have any body.e.g.
class a: class b
(
public void input(int a, int b);
public void output(int c, float d);
)
|
|
Question 15.
What is boxing?
Answer: conversion from value type to reference type
|
|
Question 16.
What’s a delegate?
Answer: Delegate is similar to function to pointers in C++, but are of type-safe references.It is a class which encapsulates a method with a specific signature.
Need for a delegate is, when an object rises an event should be able to call different event handlers under different circumstances.............
|
|
Question 17.
Differences between dataset.clone and dataset.copy?
|
|
Question 18.
What is Reflection in .NET?
|
|
Question 19.
What is the difference between in-proc and out-of-proc?
|
|
Question 20.
What is IDisposable interface?
|
|
Question 21.
What is the difference between Finalize() and Dispose()?
|
|
Question 22.
What is Reflection?
|
|
Question 23.
What is CLR?
Answer: Common Language Runtime
|
|
Question 24.
What is the GAC? What problem does it solve?
Answer: GAC is globel access cashe. It has public or shaired Assembilly.
|
|
Question 25.
What is a Windows Service and how does its life cycle differ from a "standard" executable (exe)?
|
|
Question 26.
Whats the difference between a Thread and a Process?
|
|
Question 27.
What all Access Modifiers available in C#?
Answer: Access modifiers are keywords used to specify the declared accessibility of a member or a type. Below is list of Access Modifiers available in C#
public
protected
internal
private
The following five accessibility levels can be specified using the access modifiers:
public
protected
internal
internal protected
private
|
|
Question 28.
How to sort the elements of the array?
Answer: Using Sort() method on array object.
To sort in descending order use Reverse() method after Sort()
|
|
Question 29.
What's the purpose of finally block in try..catch?
Answer: finally block gets executed whether exception occured or not.
|
|
Question 30.
Whats the keyword to prevent class from being inherited by another class?
Answer: sealed
|
|
Question 31.
Is it possible to assign null value to an integer variable in c#?
Answer: Yes.
You can define nullable integer variable using following notation
DataTime? dt = null;
int? i = null;
bool? b = null;
|
|
Question 32.
Is it possible to inherit multiple classes in c#?
Answer: No.
C# does not support multiple inheritance but you can achive multi-level inheritance in c#.
|
|
Question 33.
How to catch all exceptions in c# code?
Answer: Use try...catch block to catch exceptions.
To catch all exception use base Exception class "Exception"
try
{
}
catch(Exception)
{
}
|
|
Question 34.
What's the base class in .NET?
Answer: System.Object is base class.
|
|
Question 35.
Can you store multiple data types in System.Array?
Answer: No
|
|
Question 36.
Describe advantage of using System.Text.StringBuilder over System.String?
Answer: Strings are immutable, so each time it’s being operated on, a new instance is created.
|