Java错误:编译时找不到符号
每次尝试编译此代码时,我都会收到一个错误,提示: java:13:错误:缺少方法体或声明抽象 公共静态void main(字符串[]args)Java错误:编译时找不到符号,java,compilation,Java,Compilation,每次尝试编译此代码时,我都会收到一个错误,提示: java:13:错误:缺少方法体或声明抽象 公共静态void main(字符串[]args) 我是Java新手。nextDouble()方法区分大小写。注意大写的D方法是nextDouble它是nextDouble(),而不是nextDouble()。另外,删除公共静态void main(String[]args)中的假分号;{… /* ================================================= * Na
我是Java新手。
nextDouble()
方法区分大小写。注意大写的D
方法是nextDouble
它是nextDouble()
,而不是nextDouble()
。另外,删除公共静态void main(String[]args)中的假分号;{…
/* =================================================
* Name: Kaleb Prichard
* ID #: 140289
* Section: CS 202 - 1
* Program: 4
* ================================================= */
import java.util.Scanner;
public class fourthProgram
{
// This is where the program begins execution
public static void main(String[] args);
{
double mealCost, tax, mealCount, subtotal, total;
Scanner keyboard = new Scanner(System.in);
System.out.println("This program will display a receipt showing the subtotal, tax, and total cost of the purchase.");
System.out.println("How much does a MEAL COST ?");
mealCost = keyboard.nextDouble();
System.out.println("How many meals is the customer PURCHASING ?");
mealCount = keyboard.nextDouble();
subtotal = mealCost * mealCount;
tax = 7.5 * subtotal;
total = subtotal + tax;
System.out.print(total%5.2);
//TOTAL is in dollars
}
}