Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Monday, 5 November 2012

Another program to illustrate the use of explicit interface implementation


using System;
class ExplicitInterface
{
 interface readFile
 {
  void Read();
  void Write();
 }

Program to show the inheritance using abstract class


using System;
class Program
{
 static void Main()
 {
  ABS[] aArray = new ABS[3];

Program to illustrate the use of explicit interface implementation


using System;
interface I1
{
 void Display();
}
interface I2

Program for inheriting a class that implements an interface


using System;
interface Display
{
 void Print();
}
class B : Display
{
 public void Print()

Program for multiple implimentation of an interface


using System;
interface Area
{
 double Compute(double x);
}
class Square : Area
{
 public double Compute(double x){ return x*x; }

Program for Implementation of multiple interface


using System;
interface Addition { int Add(); }
interface Multiplication { int Mul(); }
class Computation : Addition , Multiplication
{
 int x,y;
 public Computation(int x,int y)
 {

Sunday, 4 November 2012

Program to implementing a property in C sharp.


using System;
class Number
{
 int number;
 public int Anumber

Program to show the upcasting of an object of Derived class to an object of its base class


using System;
class Maruti
{
 public virtual void Display()
 {

Program of hierarchical inheritance and function overriding


using System;
class BaseClass
{
 public int num1,num2,num3;
 public virtual int function1()
 {

Program to show the use of sealed keyword on methods in inheritance and overriding


using System;
class GrandParent
{
 private string clname;
 public GrandParent(){}

Program to show the use of sealed keyword for class in inheritance and overriding


using System;
sealed class GrandParent
{
 public void Show()
 {
  Console.WriteLine("GrandParent Class Method");

Program to show the use of abstract keyword in Inheritance


using System;
abstract class Base
{
 public Base()
 {
  Console.WriteLine("Welcome in Base Class");

Program to demonstrate the use of virtual and override keyword


using System;
class GrandParent
{
 public virtual void Display()
 {

Wednesday, 31 October 2012

How to Compile the C-sharp programs through normal command prompt (cmd.exe) other than visual studio command prompt?


First of all open run window and type cmd and then press 'enter' or click 'ok' button. Then go to the folder or make a folder where you want to create and compile .cs file (C-Sharp source code).
For example:-

Thursday, 20 September 2012

Why C#?


A large number of computer languages, starting from FORTRAN developed in 1957 to the object oriented language Java introduced in 1995, are being used for various applications. The choice of language depends upon many factors such as H/W environment,

What is C#?


C# (pronounced as ‘C sharp’) is a new computer programming language developed by Microsoft Corporation, USA. C#’s chief architect was Anders Hejlsberg. It is fully object oriented language like java and is the first component oriented language. It has been designed to support the key feature of .NET framework, the new development platform of Microsoft for building component based software solutions. It is simple, efficient, productive, and type safe language derived from C and C++ languages. It is a modern language suitable for developing web based applications.