why it is like this?
i have a query though stupid one
why this difference in output? is there any specific reasons or just like that it happens.
The System.out object is a PrintStream; when you read the API documentation you'll see that that class has a print(char c) method so it knows how to print a character array; it doesn't know how to print an int array so it uses its toString() method to at least be able to print something.
Originally Posted by himanshu19
Int arrays don't have a toString() method, they inherit one from the Object class which just prints the class name, and at sign and the hash code of the object.
Thanks for the explanation.
have a good day.