Não entendi o que o compliador disse ??? - Mesmo colocando o public static string void main ele diz que não localiza e não executa o programa Java, se alguém puder me ajudar com isso , estou colocando ai o codigo :
//Here is a simple Java program that implements some basic bank operations, such as account registration,
//opening and closing accounts, checking account balances, making deposits and withdrawals, and generating account statements.
// This program uses object-oriented programming principles, such as encapsulation, inheritance, and polymorphism.
import java.util.Scanner;
// This is the superclass that defines the common characteristics of all bank accounts
class BankAccount {
public static void main(String args[]) {
private int accountNumber;
private String accountHolder;
private double balance;
// This is the default constructor for the BankAccount class
public BankAccount() {
this.accountNumber = 0;
this.accountHolder = "";
this.balance = 0.0;
}
// This is the parameterized constructor for the BankAccount class
public BankAccount( int accountNumber, String accountHolder,double balance){
this.accountNumber = accountNumber;
this.accountHolder = accountHolder;
this.balance = balance;
}
// This method returns the account number
public int getAccountNumber () {
return this.accountNumber;
}
// This method sets the account number
public void setAccountNumber ( int accountNumber){
this.accountNumber = accountNumber;
}
// This method returns the account holder's name
public String getAccountHolder () {
return this.accountHolder;
}
// This method sets the account holder's name
public void setAccountHolder (String accountHolder){
this.accountHolder = accountHolder;
}
// This method returns the account balance
public double getBalance () {
return this.balance;
}
// This method sets the account balance
public void setBalance ( double balance){
this.balance = balance;
}
// This method allows the customer to deposit money into their account
public void deposit ( double amount){
this.balance += amount;
System.out.println("Deposit successful. Current balance: " + this.balance);
}
// This method allows the customer to withdraw money from their account
public void withdraw ( double amount){
if (amount > this.balance) {
System.out.println("Insufficient funds. Current balance: " + this.balance);
} else {
this.balance -= amount;
System.out.println("Withdrawal successful. Current balance: " + this.balance);
}
}
// This method generates an account statement for the customer
public void generateStatement () {
System.out.println("Account number: " + this.accountNumber);
System.out.println("Account holder: " + this.accountHolder);
System.out.println("Current balance: " + this.balance);
}
}
// This is a subclass of the BankAccount class that represents a savings account
class SavingsAccount extends BankAccount {
// This is the default constructor for the SavingsAccount class
public SavingsAccount() {
super();
}
// This is the parameterized constructor for the SavingsAccount class
public SavingsAccount(int accountNumber, String accountHolder, double balance) {
super(accountNumber, accountHolder, balance);
}
}
}