TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jonathan Oberhaus
NA
6
11.1k
Method is used like a type
Nov 29 2012 2:15 PM
I have a derived class called Bourbon that I am making, however I keep getting an error on the line that I bolded that says the method is being used like a type?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Test
{
class Bourbon : Whiskey
{
Bourbon[] bBottles = new Bourbon[5];
public Bourbon(string name, string distillery, int age)
{
Name = name;
Distillery = distillery;
Age = age;
}
public void PopulateBottles()
{
Console.WriteLine("Please enter the information for 5 bourbons:");
for (int runs = 0; runs < 5; runs++)
{
Console.WriteLine("Name:");
var name = Console.ReadLine();
Console.WriteLine("Distillery:");
var distillery = Console.ReadLine();
Console.WriteLine("Age:");
var age = int.Parse(Console.ReadLine());
var bourbon
= new Bourbon(name, distillery, age);
bBottles[runs] = bourbon;
}
}
}
}
Reply
Answers (
1
)
how to get selected text from a text document file in C#?
Issue with Calling a Child Inside MDIParent.