У меня есть проблемы запуска следующий код, он говорит 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
{
...
}
Ваш sscce не совсем короткие :) –
я уезжаю это в комментарии вместо ответа, потому что это дикие догадки, но, может быть, ваш компилятор ищет 'main' класс, а не' main' метод, или, может быть, он ищет «главную», которая не бросает «IO Exception' –
На самом деле проблема не в том, что вы опубликовали в SSCCE. Это что-то еще. –