This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
17
This compiles and runs fine without "virtual" and "override." Were they necessary before? My book (head start C#) seems to suggest that it would have an error. Is it still a good idea to use them?
Post Flair (click to view more posts with a particular flair)
Post Body
code:
Penguin penny = new Penguin();
penny.Fly();
class Vertebrate
{
public int Legs { get; set; }
}
class Bird : Vertebrate
{
public double Wingspan;
public void Fly()
{
//code to make ti fly
Console.WriteLine("I'm flying!");
}
}
class Penguin : Bird
{
public void Fly()
{
Console.WriteLine("Penguins can't fly!");
}
}
Output: Penguins can't fly!
Author
Account Strength
100%
Account Age
15 years
Verified Email
Yes
Verified Flair
No
Total Karma
639,966
Link Karma
107,616
Comment Karma
529,103
Profile updated: 1 day ago
Posts updated: 3 months ago
Subreddit
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/csharp/comm...