Derived Class

Unknown | 12:44 AM |

VB.NET



Class Customer
Inherits Person
Public CustId As Integer
Public DebitBalance As Double
Public ReadOnly Property Debit() As Double
Get
Return DebitBalance
End Get
End Property
End Class





Class Employee
Inherits Person
Public EmpId As Integer
Private Sal As Double = 0
Public Basic As Double
Public Allowance As Double
Public Deductions As Double
Public ReadOnly Property Salary() As Double
Get
Return Sal
End Get
End Property
Public Sub ProcessSalary()
Sal = Basic + Allowance - Deductions
End Sub
End Class



C#



class Customer:Person
{
public int CustId ;
public double DebitBalance;
public double Debit()
{
get
{
return DebitBalance;
}
}
}







class Employee: Person
{
public int EmpId ;
private double Sal = 0;
public double Basic ;
public double Allowance;
public double Deductions;
public double Salary
{
get
{
return Sal;
}
}
public void ProcessSalary()
{
Sal = Basic + Allowance – Deductions;
}
}

Category:

About http://dotnetvisual.blogspot.in/:
DOT NET TO ASP.NET is a web application framework marketed by Microsoft that programmers can use to build dynamic web sites, web applications and web services. It is part of Microsoft's .NET platform and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime, allowing programmers to write ASP.NET code using any Microsoft .NET language. create an application very easily ....