Following is the program to implement interface, what can interface contain?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Interface
interface Workforce
void GetEmpData();
void DispalyEmpData();

class Architect : Workforce
int EmpId;
string EName;
double Bonus, CA;
public void GetEmpData()
Console.Write("Enter Architects Details :-");
EmpId = Convert.ToInt32(Console.ReadLine());
EName = Console.ReadLine();
Bonus = Convert.ToDouble(Console.ReadLine());
CA = Convert.ToDouble(Console.ReadLine());
public void DispalyEmpData()
Console.WriteLine("Architect Id is" + EmpId);
Console.WriteLine("Architect Name is" + EName);
Console.WriteLine("Architect Bonus is" + Bonus);
Console.WriteLine("Architect CA is" + CA);

static void Main(string[] args)

Architect Obj1 = new Architect();


Enter architect Detail is-- 10
Architect Id is:- 10
Architect Name is:- ravi
Architect Bonus is:- 15000
Architect CA is:- 25000

Above is an example of program that implements interface. But I would like experts, professionals and gurus to especially those who are currently working at leading and best software development company to help me understand the real definition of interface and what can interface contain?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!