About us |  Help us improve
intelliVERB - Get a fair search of the Internet !
Visual studio .net
SQL Server
Oracle
Main  >  Object oriented Email this page to friend
Abstract class
Enumeration
Inheritance
Interface
Sealed class
 
 
 
 
 
C#EnumerationTop

//Enum
enum Developer_Level
{

//setting the value of our first enumerator to 1 instead of 0 which is the default value

 Junior=1,
 Midlevel,
 Senior,
 Architech,
 Manager
}


C#InterfaceTop


//Interface
interface IEmployee
{
 string Empl_Id
 {
  get;
  set;
 }
 string First_Name
 {
  get;
  set;
 }
 string Last_Name
 {
  get;
  set;
 }
 DateTime DOB
 {
  get;
  set;
 }
 double CalculateAge();
}

interface ITask
{
 bool IsPending(out DateTime Deadline);
 bool IsDone(out DateTime Achievedon);
 bool HasPassedDealine(out DateTime Deadline);
}

interface IDeveloper
{
 string CurrentProject
 {
  get;
  set;
 }
 Developer_Level Level
 {
  get;
  set;
 }
 Task[] ToDoList
 {
  get;
  set;
 }
 Task[] PendingTasks();
}


C#Sealed classTop

/// <summary>
/// HR_Tools is a sealed class
/// its inheritance is then prohibited
/// none of its methods should be overridden
/// </summary>

public sealed class HR_Tools
{

 public bool CalulateSalary(Employee oEmployee)
 {
  //Salary calculation instructions
  //.....
  //.....
  //generate salary data

  return true;
 }

 public bool CalulateVacation(Employee oEmployee)
 {
  //Employee vacation calculation instructions
  //.....
  //.....
  

  return true;
 }
}


C#Abstract classTop

/// <summary>
/// Factory is our data manipulation abstract class
/// it can not be instantiate, it has to be inherited
/// and its methods implemented
/// </summary>

public abstract class Factory
{

 public abstract object Create();

 public abstract bool Update(object oObject);

 public abstract bool Delete(object oObject);

}

You last visited
Web Objects
XML
 
 
Make a secure donation now with PayPal!