Вы находитесь на странице: 1из 2

http://www.interviewquestions365.

com/interview-questions/ajax-sample-interview-q
uestions.html
AJAX, or Asynchronous JavaScript and XML, is a new way for web pages to send and
receive data to and from a web site
without forcing the user to wait for a new page to load.
A class can be declared static, indicating that it contains only static members.
It is not possible to create instances
of a static class using the new keyword. Static classes are loaded automatically
by the .NET Framework common language runtime (CLR) when the program or namespa
ce containing the class is loaded.
Use a static class to contain methods that are not associated with a particular
object. For example, it is a common requirement to create a set of methods that
do not act on instance data and are not associated to a specific object in your
code. You could use a static class to hold those methods.
The main features of a static class are:
They only contain static members.
They cannot be instantiated.
They are sealed.
They cannot contain Instance Constructors (C# Programming Guide).
Creating a static class is therefore much the same as creating a class that cont
ains only static members and a private constructor. A private constructor preven
ts the class from being instantiated.
The advantage of using a static class is that the compiler can check to make sur
e that no instance members are
accidentally added. The compiler will guarantee that instances of this class can
not be created.
Static classes are sealed and therefore cannot be inherited. Static classes cann
ot contain a constructor, although it is still possible to declare a static cons
tructor to assign initial values or set up some static state. For more informati
on, see Static Constructors (C# Programming Guide).
What is a static class?
We can declare a static class. We use static class when there is no data or beha
vior in the class that depends on object
identity. A static class can have only static members. We can not create instanc
es of a static class using the new
keyword. .NET Framework common language runtime (CLR) loads Static classes autom
atically when the program or namespace containing the class is loaded.
Here are some more features of static class
Static classes only contain static members.
Static classes can not be instantiated. They cannot contain Instance Constructors

Static classes are sealed.
What is abstract class ?
Abstract class is a base class or a parent class. Abstract classes can have emp
ty abstract methods or it can have
implemented methods which can be overridden by child classes.
The next question i expected was on interfaces and yes there it comes.
What are interfaces?
Interface is a contract class with empty methods , properties and functions. Any
class which implements the interface
has to compulsory implement all the empty methods , functions and properties of
the interface.
Now the 1000% sure question was bound to come difference between them...
What's the difference between abstract class and interface?
There are many differences, below are some key two differences :-
Abstract class are base class or parent class while interfaces are contracts.
Abstract class can have some implemented methods and functions while interfaces m
ethods and functions are completely empty.
Abstract classes are inherited while interfaces are implemented.
Abstract classes are used when we want to increase reusability in inheritance whi
le interfaces are used to force a contract.

Вам также может понравиться