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

Top 5 Contributors of the Month

Post New Resource Bookmark and Share   


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
        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);



Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply

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