在尝试通过putty编译java程序时,我遇到以下错误:需要类、接口或枚举

rqqzpn5f  于 2021-06-30  发布在  Java
关注(0)|答案(0)|浏览(245)

对这个代码进行了一段时间的故障排除,但似乎找不到原因。抱歉,我遗漏了一些明显的东西。我对这个比较陌生:

package com.paypal.bfs.test.employeeserv.api;

import java.text.DecimalFormat;

public class SaleP2 {

    public static void main(String args[])

    {
    final double TAXRATE = 0.06;
    double bookPrice1, bookPrice2, tax, totalSale;
    bookPrice1 = 55.00;
    bookPrice2 = 75.25;
    tax = (bookPrice1 + bookPrice2) * TAXRATE;
    totalSale = bookPrice1 + bookPrice2 + tax;
    DecimalFormat twoDigits = new DecimalFormat("0.00");
    System.out.println("CSIS DEPT BOOK SALE");
    System.out.println();
    System.out.println("Book1: " + twoDigits.format(bookPrice1));
    System.out.println("Book2: " + twoDigits.format(bookPrice2));
    System.out.println();
    System.out.println("Tax: " + twoDigits.format(tax));
    System.out.println();
    System.out.println("Total Sale: " + twoDigits.format(totalSale));
    System.out.println();
    System.out.println(" ~* end *~ ");
    }

}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题