我的预订课程中有一个构造函数如下:
public Booking (String name, String phone, int [] adultSeats, int [] childSeats )
{
this.name = name;
this.phone = phone;
this.adultSeats = adultSeats;
this.childSeats = childSeats;
}
Run Code Online (Sandbox Code Playgroud)
我想通过创建Booking对象来编写一个Tester类来执行构造函数.
我做了很多尝试,例如:
试试1: Booking b1 = new Booking ("Ali","32788943",{0,1},{3,4,5}) ;
试试2: Booking b1 = new Booking ("Ali","32788943",2,3) ;
如何在Tester类中执行构造函数?
谢谢.