Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous tree type: <any>
at pkgfinal.Final.main
我以前从未遇到过此错误,我尝试过更改pkg详细信息,并且完全创建了一个新项目来尝试绕过此问题。
package pkgfinal;
import java.util.Scanner;
public class Final {
public static void main(String[] args) {
double child = 18.00;
double adult = 36.00;
double senior = 32.50;
double ticketTotal = 0;
double moneyTotal = 0;
int i = 0;
do {
Scanner input = new Scanner(System.in);
System.out.println("Choose your ticket type, Please press 1 for Child, 2 for Adult or 3 for Senior.");
Scanner ticketType = new Scanner(System.in);
double ticketType = input.nextdouble();
System.out.println("Choose your ticket type, Please press 1 for Child, 2 for Adult or 3 for Senior.");
Scanner ticketType = new Scanner(System.in);
double ticketTotal = input.nextdouble();
if (ticketType == 1) {
ticketTotal = ("Child");
} else if (ticketType == 2) {
ticketTotal = ("Adult");
} else if (ticketType == 3) {
ticketTotal = ("Senior");
} else {
System.out.println("I'm sorry that is an invalid choice");
System.out.println("Goodbye.");
return;
我对其余的代码非常有信心,这是我尝试实现的简单票务系统,有人可以解释一下实际的问题吗?我刚刚更新了IDE,因为我在编写代码时没有注册错误,因此遇到了一些问题
谢谢。