【发布时间】:2010-10-11 19:17:03
【问题描述】:
我正在按照教程创建一个类:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Session3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Vehicle my_Car = new Vehicle;
}
}
class Vehicle
{
uint mileage;
byte year;
}
}
我在这一行收到提到的错误:
private void button1_Click(object sender, EventArgs e)
{
Vehicle my_Car = new Vehicle;
}
有谁知道我做错了什么?
【问题讨论】:
-
试试这个:Vehicle my_Car = new Vehicle();
标签: c# constructor compiler-errors