- Features of asp.net 4.0 and 3.5
- Difference b/w == and equals in c#
- Optional parameters are supports in c#(yes)
- Close and dispose methods in c#
- Array list and hash table diff
- Types of hosting
- Types of contracts
- Was hosting
- How to implement wcf service
- How to implement method overloading in wcf
- How to pass data from one master page to another master page
- Popup window in asp.net
- In proc and out proc differences
- Query string( syntax)
- Query optimization
- union and union all difference
- Views and advantages
- Cursors(syntax)
- xmldocument inherits from
.Net and SharePoint Interview Questions and Solutions
Latest CapGemini Interview Questions
Collections In C#.Net
Collection class provides Dynamic Operations, which is not possible in Regular Arrays
like Insert, Add, Clear, and Remove
All collection classes are available in System.Collection
Collection Classes are
ArrayList
Stack
Queue
Hash-table
like Insert, Add, Clear, and Remove
All collection classes are available in System.Collection
Collection Classes are
ArrayList
Stack
Queue
Hash-table
Difference between ArrayLst and HashTable
ArrayList
ArrayList is a liner data structure that hold items just like an array
Each element can be accessed with index
The size of the ArrayList object will increase dynamically based on requirement
It allows null values and duplicate values
we can store only similar type of data
Hash Table
Hash Table store data as key,value pairs
Each elements can be accessed with index/Key
it doesn't allow null and duplicate values
we can store different type of data
ArrayList is a liner data structure that hold items just like an array
Each element can be accessed with index
The size of the ArrayList object will increase dynamically based on requirement
It allows null values and duplicate values
we can store only similar type of data
Hash Table
Hash Table store data as key,value pairs
Each elements can be accessed with index/Key
it doesn't allow null and duplicate values
we can store different type of data
Diff b/w Abstract Class and Interface
Abstract Class
Abstract class is a class but not a complete class for creating object
So we can not create a object for Abstract classes
But a reference can be created
Abstract classes are also called as "Partial Abstract classes"
After creating Abstract class it can not be instantiated by itself
It must be inherited by child classes
Abstract class provides set of rules to implement next class
Rules will be provided by Abstract methods
Abstract methods does not contain any definition
While inheriting abstract class from child class all abstract methods must be override other that child class should be a abstract class
If a class contain at least one abstract method then it must be declared as "Abstract class"
Partial abstract class may contain function with body and function without body
If a class contains all functions without body then it is called as "Fully Abstract Class"
Interface
Interface is not a class
Interfaces supports multiple inheritance
Interfaces are implementable
In Interface all methods are abstract methods and by default public Access Modifier
A class can implement multiple interfaces
If a class has implement a interface that should be provide a implementation for all the methods
one interface can inherit another interface
Abstract class is a class but not a complete class for creating object
So we can not create a object for Abstract classes
But a reference can be created
Abstract classes are also called as "Partial Abstract classes"
After creating Abstract class it can not be instantiated by itself
It must be inherited by child classes
Abstract class provides set of rules to implement next class
Rules will be provided by Abstract methods
Abstract methods does not contain any definition
While inheriting abstract class from child class all abstract methods must be override other that child class should be a abstract class
If a class contain at least one abstract method then it must be declared as "Abstract class"
Partial abstract class may contain function with body and function without body
If a class contains all functions without body then it is called as "Fully Abstract Class"
Interface
Interface is not a class
Interfaces supports multiple inheritance
Interfaces are implementable
In Interface all methods are abstract methods and by default public Access Modifier
A class can implement multiple interfaces
If a class has implement a interface that should be provide a implementation for all the methods
one interface can inherit another interface
Basic Questions
Class
Object
diff b/w class and object
diff b/w two objects
Encapsulation
Abstraction
Data corruption
Constructor and types
void
Method
diff b/w method and constructor
splitup notation
shortcut notation
Gc
Memory leak
Access Modifiers
private
public
internal
protected
protected internal
static class
diff b/e static method and non-static method
static,constant and readonly
ploymorphism
Method overloading
Method overriding
Inheritance
base calss
derived class
base keyword
sealed class
Type compharison operator IS
Nested classes
diff b/w ref & out parameters
Finalize() and Dispose()
assert()
Debug class and Trace class
Do events have return type
can events have access modifiers
can we have shared events
what is shadowing
diff b/w class and strucutre
diff b/w Abstract class and interface
Object
diff b/w class and object
diff b/w two objects
Encapsulation
Abstraction
Data corruption
Constructor and types
void
Method
diff b/w method and constructor
splitup notation
shortcut notation
Gc
Memory leak
Access Modifiers
private
public
internal
protected
protected internal
static class
diff b/e static method and non-static method
static,constant and readonly
ploymorphism
Method overloading
Method overriding
Inheritance
base calss
derived class
base keyword
sealed class
Type compharison operator IS
Nested classes
diff b/w ref & out parameters
Finalize() and Dispose()
assert()
Debug class and Trace class
Do events have return type
can events have access modifiers
can we have shared events
what is shadowing
diff b/w class and strucutre
diff b/w Abstract class and interface
partial class in C#.Net
Partial class is introduced in .Net 2.0
partial class is a new way of defining class
it allows you to define a class into multiple partial classes
During compilation time compiler simply groups all partial classes into one class
partial classes should be preceded with Partial Keyword
All the partial classes should be defined in the same namespace
Method signature should be unique
partial class is a new way of defining class
it allows you to define a class into multiple partial classes
During compilation time compiler simply groups all partial classes into one class
partial classes should be preceded with Partial Keyword
All the partial classes should be defined in the same namespace
Method signature should be unique
Diff b/w String and String Builder in C#.Net
Strings:
String s="Santhosh"
String Builder:
- Strings are internally represented as character array
- System namespace contains a class string
- System.String class is used to work with string litter ls
- String litterls are nothing but a Sequence of Characters these are enclosed with double quotes
- when we want to use string methods every time we have to create string object in the memory
- so it will degrade the performance of application
- strings are immutable means,value cant be changed
String s="Santhosh"
String Builder:
- String Builder is mutable means,value can be changed
- when we want to modify a string using string builder no need to create object
- it will improves the performance of application
Subscribe to:
Comments (Atom)