title: Array of classes and methods in Java
body: <p>Okay, so I have a little assignment to do which needs some array of classes and calling various methods to get the job done. Essentially, I am looking to learn a bit through this program as well and the idea of it is to create a customer account, deposit, withdraw etc. I have written this code so far and I am getting the errors that I gave below. Please help me out in any way possible. And is var++ not an allowed option to increment a number in Java??</p>
  
  <pre><code>import java.util.*;
  
  public class Bank
      {
          int cId;
          String cName;
          float cBalance;
      }
  class Banking
  {
  public static void main(String args[])
  {
  
  
      int limit=1;
      System.out.println(+limit);
      while (limit==1)
      {
      System.out.println("Menu:");
      System.out.println("1. Add Customer");
      System.out.println("2. View Customer Details");
      System.out.println("3. Banking Options");
      System.out.println("Enter choice:");
      Scanner scan = new Scanner (System.in);
      int i=scan.nextInt();
      switch (i)
      {
          case 1:
              {
                  System.out.println("Add the customer");
                  Customer();
              }
          /*case 2:
              {
                  System.out.println("Customer details");
                  getCustomer();
              }
          case 3:
              {
                  System.out.println("Banking options");
                  System.out.println("1. Deposit");
                  System.out.println("2. Withdraw");
                  System.out.println("3. Balance Enquiry");
                  Scanner scan1 = new Scanner (System.in);
                  int j=scan1.nextInt();
                  switch (j)
                  {
                      case 1:
                          {
                                                             System.out.println("Deposit");
                              deposit();
                          }
                      case 2:
                          {
                                                             System.out.println("Withdraw");
                              withdraw();
                          }
                      case 3:
                          {
                                                             System.out.println("Balance Enquiry");
                              balance();
                          }
                  }
              }
      }   */
      System.out.println("Enter 0 to exit or 1 to continue operations");
      Scanner s = new Scanner (System.in);
      limit=scan.nextInt();
      }
  }
  }
  }
  public static void Customer (String []a)
  {
      int cust=0;
      Bank c[cust] = new Bank();
      System.out.println("Enter customer ID:");
      Scanner scan11 = new Scanner (System.in);
      int k=scan11.nextInt();
      c[cust].cId=k;
      System.out.println("Enter customer name:");
      Scanner scan12 = new Scanner (System.in);
      String name=scan12.next();
      c[cust].cName=name;
      System.out.println("Enter starting balance:");
      Scanner scan132 = new Scanner (System.in);
      float bal=scan132.nextFloat();
      c[cust].cBalance=bal;
  
      System.out.print("Customer id=" +c[cust].cId );
      cust++;
  
  
  }
  
  }
  </code></pre>
  
  <p>And the errors are given here:</p>
  
  <pre><code>bank.java:73: class, interface, or enum expected
          public static void Customer (String []a)
                        ^
  bank.java:76: class, interface, or enum expected
                  Bank c[cust] = new Bank();
                  ^
  bank.java:77: class, interface, or enum expected
                  System.out.println("Enter customer ID:");
                  ^
  bank.java:78: class, interface, or enum expected
                  Scanner scan11 = new Scanner (System.in);
                  ^
  bank.java:79: class, interface, or enum expected
                  int k=scan11.nextInt();
                  ^
  bank.java:80: class, interface, or enum expected
                  c[cust].cId=k;
                  ^
  bank.java:81: class, interface, or enum expected
                  System.out.println("Enter customer name:");
                  ^
  bank.java:82: class, interface, or enum expected
                  Scanner scan12 = new Scanner (System.in);
                  ^
  bank.java:83: class, interface, or enum expected
                  String name=scan12.next();
                  ^
  bank.java:84: class, interface, or enum expected
                  c[cust].cName=name;
                  ^
  bank.java:85: class, interface, or enum expected
                  System.out.println("Enter starting balance:");
                  ^
  bank.java:86: class, interface, or enum expected
                  Scanner scan132 = new Scanner (System.in);
                  ^
  bank.java:87: class, interface, or enum expected
                  float bal=scan132.nextFloat();
                  ^
  bank.java:88: class, interface, or enum expected
                  c[cust].cBalance=bal;
                  ^
  bank.java:90: class, interface, or enum expected
                  System.out.print("Customer id=" +c[cust].cId );
                  ^
  bank.java:91: class, interface, or enum expected
                  cust++;
                  ^
  bank.java:94: class, interface, or enum expected
          }
          ^
  17 errors
  </code></pre>
  
  <p>Thanks a lot guys!!</p>