In the First Case, you are comparing the address of the two array which will always be different. Here value of a = 1000 (address 1), b = 2000 (address 2) and as we know they cannot be stored on the same address therefore, the result is false.
In the Second Case, you are making a string in a memory and you are pointing to that memory, like TAJ is stored in consecutive memory location suppose starting from address 1000, i.e. T → 1000 ( address ). this type of declaring is also called “string constant”.
So, in the Second Case, as we are using the same string, a & b both point to the same string present in the memory (compiler optimization). Therefore there pointing address is the same, making the result is true.
NOTE: the variables a and b are present at different memory location, they just point to the same memory location.