主题:求高手帮助,找不到类型或命名空间名称,要怎么解决
实验出了问题,原本在机房用的vs05运行得好好的,不知怎么的回来用08的就出现问题了
先看看代码吧
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication10
{
class Program
{
static void Main(string[] args)
{
Fruit t1 = new Fruit();
Console.WriteLine("请输入一个水果");
}
public abstract class Fruit
{
/// <summary>
/// 获得水果的色
/// </summary>
public virtual void GetColor()
{
}
/// <summary>
/// 获得水果的形状
/// </summary>
public virtual void GetShape()
{
}
/// <summary>
/// 获得水果的口味
/// </summary>
///
public virtual void GetTaste()
{
}
}
}
/// <summary>
/// 桔子
/// </summary>
public class Orange : Fruit
{
public Orange()
{
}
public override void GetColor()
{
Console.WriteLine("桔子是黄色的。");
base.GetColor();
}
public override void GetShape()
{
Console.WriteLine("桔子是球形的。");
base.GetShape();
}
public override void GetTaste()
{
Console.WriteLine("桔子是酸甜的。");
base.GetTaste();
}
}
/// <summary>
/// 苹果
/// </summary>
public class Apple : Fruit
{
public Apple()
{
}
public override void GetColor()
{
Console.WriteLine("苹果是红色的。");
base.GetColor();
}
public override void GetShape()
{
Console.WriteLine("苹果是球形的。");
base.GetShape();
}
public override void GetTaste()
{
Console.WriteLine("苹果是甜的。");
base.GetTaste();
}
}
/// <summary>
/// 香蕉
/// </summary>
public class Banana : Fruit
{
public Banana()
{
}
public override void GetColor()
{
Console.WriteLine("香蕉是浅黄色的。");
base.GetColor();
}
public override void GetShape()
{
Console.WriteLine("香蕉是条形的。");
base.GetShape();
}
public override void GetTaste()
{
Console.WriteLine("香蕉是甜的。");
base.GetTaste();
}
}
}
运行最后出现了
错误 1 找不到类型或命名空间名称“Fruit”(是否缺少 using 指令或程序集引用)
要怎么办呀,
求高手帮助
先看看代码吧
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication10
{
class Program
{
static void Main(string[] args)
{
Fruit t1 = new Fruit();
Console.WriteLine("请输入一个水果");
}
public abstract class Fruit
{
/// <summary>
/// 获得水果的色
/// </summary>
public virtual void GetColor()
{
}
/// <summary>
/// 获得水果的形状
/// </summary>
public virtual void GetShape()
{
}
/// <summary>
/// 获得水果的口味
/// </summary>
///
public virtual void GetTaste()
{
}
}
}
/// <summary>
/// 桔子
/// </summary>
public class Orange : Fruit
{
public Orange()
{
}
public override void GetColor()
{
Console.WriteLine("桔子是黄色的。");
base.GetColor();
}
public override void GetShape()
{
Console.WriteLine("桔子是球形的。");
base.GetShape();
}
public override void GetTaste()
{
Console.WriteLine("桔子是酸甜的。");
base.GetTaste();
}
}
/// <summary>
/// 苹果
/// </summary>
public class Apple : Fruit
{
public Apple()
{
}
public override void GetColor()
{
Console.WriteLine("苹果是红色的。");
base.GetColor();
}
public override void GetShape()
{
Console.WriteLine("苹果是球形的。");
base.GetShape();
}
public override void GetTaste()
{
Console.WriteLine("苹果是甜的。");
base.GetTaste();
}
}
/// <summary>
/// 香蕉
/// </summary>
public class Banana : Fruit
{
public Banana()
{
}
public override void GetColor()
{
Console.WriteLine("香蕉是浅黄色的。");
base.GetColor();
}
public override void GetShape()
{
Console.WriteLine("香蕉是条形的。");
base.GetShape();
}
public override void GetTaste()
{
Console.WriteLine("香蕉是甜的。");
base.GetTaste();
}
}
}
运行最后出现了
错误 1 找不到类型或命名空间名称“Fruit”(是否缺少 using 指令或程序集引用)
要怎么办呀,
求高手帮助