0

我在运行以下代码时遇到问题,它说Error: Could not find or load main class但我显然在代码中有一个主...

    package abc;

import java.io.IOException;
import javax.swing.JOptionPane;

// As its name implies, this is what is driving the program, asking for input, giving output, etc.
public class driver
{
    @SuppressWarnings("unused")
    public static void main(String args[]) throws IOException // a main that throws an exception... hmmm... yes it's odd, but apparently not illegal
    {
        ....}

    private static void processTransaction(String trans, Customer[] customers) throws IOException // this is the function that processes the given transaction
    {
        ...
}

// An object representing a person who may have one or more bank accounts
class Customer
{
    ...
}

class BankAccount 
{
    ...
}

class CheckingAccount extends BankAccount // extends BankAccount with added functionality
{
    ...
}

class SavingsAccount extends BankAccount // extends BankAccount with added functionality
{
    ...
}
4

1 回答 1

6

尝试将您的类访问说明符公开

public class driver
于 2012-11-13T17:23:29.477 回答