Write a Java program that stores Customer accounts with the attributes:

(i) Name of the depositor
(ii) Account number
(iii) Type of account
(iv) Balance amount
And the methods:
(i) Deposit
(ii) Withdraw
(iii) Display the balance
You need to create an array of objects to store ten customers. Every time a customer wants to deposit or withdraw, he or she needs to supply the account number and the amount to withdraw or deposit. When a customer asks for a balance he or she needs to supply the account number. You also need to check that the customer did not withdraw more than the balance that he or she has in the account.

i was also searching for the answer and i found this. lol. I guess we r from the same class :D

Sure! Here's an example Java program that implements the customer account functionality you described:

```java
import java.util.Scanner;

class Customer {
String name;
int accountNumber;
String accountType;
double balance;

public Customer(String name, int accountNumber, String accountType, double balance) {
this.name = name;
this.accountNumber = accountNumber;
this.accountType = accountType;
this.balance = balance;
}

public void deposit(double amount) {
balance += amount;
System.out.println("Deposited: $" + amount);
}

public void withdraw(double amount) {
if (amount > balance) {
System.out.println("Insufficient balance");
} else {
balance -= amount;
System.out.println("Withdrawn: $" + amount);
}
}

public void displayBalance() {
System.out.println("Account Balance: $" + balance);
}
}

public class CustomerAccount {

public static void main(String[] args) {
Customer[] customers = new Customer[10];

// Initialize some test data
customers[0] = new Customer("John Doe", 1001, "Checking", 5000.0);
customers[1] = new Customer("Jane Smith", 1002, "Savings", 10000.0);

Scanner scanner = new Scanner(System.in);

int accountNumber;
double amount;

System.out.println("Enter account number: ");
accountNumber = scanner.nextInt();

// Find the customer with the given account number
Customer customer = null;
for (Customer c : customers) {
if (c != null && c.accountNumber == accountNumber) {
customer = c;
break;
}
}

if (customer == null) {
System.out.println("Customer not found!");
} else {
System.out.println("Enter '1' to deposit, '2' to withdraw, or '3' to display balance: ");
int option = scanner.nextInt();

switch (option) {
case 1:
System.out.println("Enter amount to deposit: ");
amount = scanner.nextDouble();
customer.deposit(amount);
break;
case 2:
System.out.println("Enter amount to withdraw: ");
amount = scanner.nextDouble();
customer.withdraw(amount);
break;
case 3:
customer.displayBalance();
break;
default:
System.out.println("Invalid option");
break;
}
}
}
}
```

This program uses a `Customer` class to represent each customer's account. The `Customer` class has instance variables `name`, `accountNumber`, `accountType`, and `balance`. It also has methods `deposit`, `withdraw`, and `displayBalance` to perform the required operations.

In the `main` method, an array of `Customer` objects is created to store the customer accounts. Test data for two customers is initialized.

The program prompts the user to enter an account number, and then searches for the corresponding customer in the array. If the customer is found, the program asks the user to select an operation: deposit, withdraw, or display balance. Based on the chosen option, the program calls the respective method on the customer object.

Keep in mind that this example program only supports one customer transaction at a time. To make it more robust and handle multiple customers and transactions, you would need to add appropriate error handling and input validation.