Difference between stored procedure and
function
1)
Procedure can return zero or n values whereas function can return one value
which is mandatory.
2)
Procedures can have input, output parameters for it whereas functions can have
only input parameters.
3)
Procedure allows select as well as DML statement in it whereas function allows
only select statement in it.
4)
Functions can be called from procedure whereas procedures cannot be called from
function.
5)
Exception can be handled by try-catch block in a procedure whereas try-catch
block cannot be used in a function.
6)
We can go for transaction management in procedure whereas we can't go in
function.
7)
Procedures cannot be utilized in a select statement whereas function can be
embedded in a select statement.
Difference between Abstract and Interface
Abstract Class:
-Abstract class provides a set of rules to
implement next class
-Rules will be provided through abstract
methods
-Abstract method does not contain any
definition
-While inheriting abstract class all abstract
methods must be override
-If
a class contains at least one abstract method then it must be declared as an
“Abstract Class”
-Abstract classes cannot be instantiated (i.e.
we cannot create objects), but a reference can be created
-Reference depends on child class object’s
memory
-Abstract classes are also called as “Partial
abstract classes”
-Partial abstract class may contain functions
with body and functions without body
-If
a class contains all functions without body then it is called as “Fully
Abstract Class” (Interface)
Interface:
-If a class contains all abstract methods
then that class is known as “Interface”
-Interfaces support like multiple inheritance
-In
interface all methods r public abstract by default
-Interfaces
r implementable
-Interfaces cannot be instantiated, but a
reference can be created
What are differences between Array list and
Hash table?
Ans: 1) Hash table store data as name,
value pair. While in array only value is store.
2) To access value from hash table, you
need to pass name. While in array, to access value, you need to pass index
number.
3) you can store different type of data in
hash table, say int, string etc. while in array you can store only similar type
of data.
What are differences between
system.stringbuilder and system.string?
The main difference is system.string is
immutable and system.stringbuilder is a mutable. Append keyword is used in
string builder but not in system.string.
Immutable means once we created we cannot
modified. Suppose if we want give new value to old value simply it will
discarded the old value and it will create new instance in memory to hold the
new value.
What are the differences between
Application object and session object?
Ans: The session object is used to maintain
the session of each user. If one user enter in to the application then they get
session id if he leaves from the application then the session id is deleted. If
they again enter in to the application they get different session id.
But
for application object the id is maintained for whole application.