Hi,
I am little confused how the "ch" value is being calculated at #2,#3.
When I print the "ch" value at #1, it prints nothing.
My doubt is when i print ba[ch] at#3 it should take as ba[null].Not
sure how it is taking the index value for ch is 0 and printing false.
I know that the default value for char is \u0000 (null character).
Any inputs?? Thanks..
import static java.lang.System.*;
public class TestClass12
{
static boolean b;
static int[] ia = new int[1];
static char ch;
static boolean[] ba = new boolean[1];
public static void main(
String args[]) throws Exception
{
out.println(" ch :"+ch);//1
boolean x = false;
if( b )
{
out.println("1");
x = ( ch == ia[ch]);
}
else x = ( ba[ch] = b );//2
System.out.println(x+" "+ba[ch]);//3
}
}