Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ClassAbstractSealed
{
// Object Orianted Programmeng
// abstract And sealed
// Abstract
abstract class parson
{
// copy object is impossible ! is it possible after creat new inheritance ?
// inheritance is possible !
public void showMsg()
{
Console.WriteLine("i'm a parson");
}
}
class programmeng:parson
{
// now possible is copy object !
string programmengLanguage; // is it not know now
}
// sealed
sealed class doctor
{
// copy object is impossible !
// inheritaince is impossible !
public void shoiwMsg()
{
Console.WriteLine("i'm a doctor");
}
}
class Program
{
static void Main(string[] args)
{
// copy object from abstract class
programmeng prog = new programmeng();
// test code
prog.showMsg();
Console.ReadKey();
}
}
}
Advertisements
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.
AcceptLearn more