.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Post New Resource Bookmark and Share   

Speed

Posted By:iswarya       Posted Date: November 16, 2011    Points: 40    Category:    URL: http://www.dotnetspark.com  

To display the speed of Jet and Plane
 

The Plane and Jet speed is displayed by using console application.
using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication3
{
    public class Plane
    {
        protected double mySpeed = 300.0D;
        public double TopSpeed
        {
            get { return mySpeed; }
            set { mySpeed = value; }
        }
    }
    class Jet : Plane
    {
        public Jet() { TopSpeed = 900.0D; }
    }
    class Airport
    {
        [STAThread]
        static void Main(string[] args)
        {
            Plane plane = new Plane();
            Console.WriteLine("plane's Top speed: {0}", plane.TopSpeed);
            Jet Jet = new Jet();
            Console.WriteLine("Jet's Top speed: {0}", Jet.TopSpeed);
            Console.ReadLine();
        }
    }

}



     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend