0

int[] ram = new int[256];

    ram['A'] = 1;
    ram['b']=2;

    System.out.println(ram.length);
    System.out.println(ram['A']);
    System.out.println(ram[065]); //065 is ascii equivalent of 'A' - op is 0??

    for (int i : ram) {

        if(ram[i]>0)
        System.out.println(ram[i]);

    }




}

How is an array accepting character as index? Usually it will be numbers .. Can someone explain the above concept?

Manoj Kumar
  • 93
  • 1
  • 3
  • 11

0 Answers0