Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Friday, June 24, 2011

Abstract Class in c#.net

Abstract Class:
Now we will discuss about abstract class in c#.net.
·         Abstract class is class we cannot create object. We only use inherit
·         We are only use base class. If u r use abstract method u must implement derived class
Abstract Class Declaration
abstract class devenvexe
{
}
A abstract class can contain  abstract method or non-abstract method .abstract method not have implementation in abstract class .but same its have derived class
Abstract Method/Non Abstract Method:
abstract class devenvexe
{ 
public abstract void abstractMethod();
public void NonAbstractMethod()
    {
        Console.WriteLine("NonAbstract Method");
    }

}
Rules:
·         Abstract class not have sealed class
·         Abstract class only contain abstract method
·         Abstract class cannot be private
·         Abstract method cant have virtual keyword.because its  explicit virtuval method
·         Abstract class cannot be static
Performance
In our testing, abstract classes with virtual methods have better performance than interface implementation .

Reserve word in C#.net


Keywords in C#.net
C#.net have  77 Reserve word. You are  not declare variable/method in reserve words .if you want to declare reserved word you can use " @ "  symbol.
Example:
private void btn_Click(object sender, EventArgs e)
        {
            string string="Welocme to DevEnvExe"
        }
Suppose if you want use above coding
private void btn_Click(object sender, EventArgs e)
        {
            string @string="Welocme to DevEnvExe"
        }
Below list are C#.net reserve words
unchecked
unsafe
ushort
boolirtual
class
abstract
as
base
byte
char
decimal
int
sbyte
uint
ulong
break
case
catch
finally
checked
const
continue
default
delegate
do
double
else
enum
event
explicit
extern
false
fixed
float
for
foreach
goto
if
implicit
in
interface
internal
is
lock
long
namespace
new
null
object
operator
out
override
params
private
protected
public
readonly
ref
return
sealed
short
sizeof
stackalloc
static
string
struct
switch
while
this
throw
true
try
typeof
using
void
volatile