Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/391.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java错误:编译时找不到符号_Java_Compilation - Fatal编程技术网

Java错误:编译时找不到符号

Java错误:编译时找不到符号,java,compilation,Java,Compilation,每次尝试编译此代码时,我都会收到一个错误,提示: java:13:错误:缺少方法体或声明抽象 公共静态void main(字符串[]args) 我是Java新手。nextDouble()方法区分大小写。注意大写的D方法是nextDouble它是nextDouble(),而不是nextDouble()。另外,删除公共静态void main(String[]args)中的假分号;{… /* ================================================= * Na

每次尝试编译此代码时,我都会收到一个错误,提示:

java:13:错误:缺少方法体或声明抽象 公共静态void main(字符串[]args)


我是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
    }
}