型後我下面的教程創建一個類:C#編譯錯誤CS1526:一種新的表達需要(),[],或{}
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(); – Crag 2010-10-11 19:19:46