Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication3
- {
- class Main
- {
- static void Main(string[] args)
- {
- Baiat m = new Baiat();
- Console.WriteLine(m.toString1());
- }
- }
- }
- public class Copil
- {
- private int age = int.Parse(Console.ReadLine(age));
- private int height = int.Parse(Console.ReadLine(height));
- public Copil(int a, int h)
- {
- this.age = a;
- this.height = h;
- }
- public String toString()
- {
- Console.WriteLine("Copilul are varsta: " + age + " si inaltimea de: " + height);
- }
- }
- public class Baiat : Copil
- {
- private String sex=Console.ReadLine();
- public String toString1()
- {
- Console.WriteLine( "Copilul are varsta: " + age + " si inaltimea de: " + height + "si sexul: " + sex);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement