我有一个小问题,我正在尝试打印位于私有方法中的几个变量的内容。但我只是不断收到“找不到符号”
下面是我试图从(包括println)读取数据的代码,我对java也很陌生。
private void createBooking()
{
String title;
String firstName;
String lastName;
String bookingNo;
String roomType;
System.out.print("Enter title: ");
title = keyboard.next();
System.out.print("Enter first name: ");
firstName = keyboard.next();
System.out.print("Enter last name: ");
lastName = keyboard.next();
System.out.print("Enter booking number: ");
bookingNo = keyboard.next();
System.out.print("Enter room type: ");
roomType = keyboard.next();
aBooking = new Booking (title, firstName, lastName, bookingNo, roomType);
}
public void printCustomerName()
{
System.out.println (createBooking.title);
}