Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
concrete class with inheritance
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here SharedCountry shujaat = new SharedCountry("shujaat", 27); Console.WriteLine(shujaat.getInformation()); Console.WriteLine(shujaat.getCountry()); SharedCountry ali = new SharedCountry("ali", 26); Console.WriteLine(ali.getInformation()); Console.WriteLine(ali.getCountry()); DifferentCountry atif = new DifferentCountry("atif", 23); Console.WriteLine(atif.getInformation()); Console.WriteLine(atif.getCountry()); } } public class ConcreteInformation { public string Name {get; set;} public int Age {get; set;} public ConcreteInformation(string name, int age){ Name = name; Age = age; } public String getInformation(){ return "Your name is :" + this.Name + " Your Age is :" + this.Age; } public virtual String getCountry(){ return "Pakistan"; } } public class SharedCountry: ConcreteInformation { public SharedCountry(string name,int age): base(name, age){} } public class DifferentCountry: ConcreteInformation { public DifferentCountry(string name,int age): base(name, age){} public override String getCountry(){ return "KSA"; } } }
run
|
edit
|
history
|
help
0
Generic operator test
Timer2
Code wall rules
Creating arrays
test1.m
Linq-Where-Condition on a collection of anonymous types
Kopi Ping Menu
Changing asp net user password
test
Калькулятор