Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Problem
- {
- public class BaseClass
- {
- public BaseClass()
- {
- Console.WriteLine("Hello, World!");
- this.PrintRandom();
- }
- public virtual void PrintRandom()
- {
- Console.WriteLine("0");
- }
- }
- public class Descendent : BaseClass
- {
- private Random randomValue;
- public Descendent()
- {
- Console.WriteLine("Bonjour, Monde!");
- randomValue = new Random();
- }
- public override void PrintRandom()
- {
- Console.WriteLine(randomValue.NextDouble().ToString());
- }
- public static void Main()
- {
- Descendent obj = new Descendent();
- obj.PrintRandom();
- Console.ReadLine();
- }
- }
- }
Add Comment
Please, Sign In to add comment