namespace shiyan3_2
{
public partial class Form4 : Form
{
public Form4()
{
InitializeComponent();
}
private void Form4_Load(object sender, EventArgs e)
{
Book[] book = new Book[10];
book[0] = new Book("chinese", "me", 21, 2,30 );
book[1] = new Book("english", "you", 28, 3, 40);
}
private void button2_Click(object sender, EventArgs e)
{
Form4 f = new Form4();
}
public class Book
{
string title;
string author;
int price;
int store;
int sellprice;
public Book()
{
}
public Book(string ti,string au,int pr,int st,int se)
{
title = ti;
author = au;
price = pr;
store = st;
sellprice = se;
}
}
}
如何在button_click中调用book【0】呢?看到一些人说不能调用的,如果不能调用那数组不就是废了
慕运维8079593
慕标琳琳
相关分类