Output

Discussion

Now from above we can say that array is a class and we have created various objects of it and we can also find which type of data it contains.

But be carefull that you don’t use getClass() with primitive type because those are not classes and that’s why getClass() function is not applicable. If you try following :

Then You will get error :

Categories: Java

faltutech

Pursuing MCA from YMCA University, Faridabad

Leave a Reply

Your email address will not be published. Required fields are marked *

Read previous post:
Convert an Array to String in Java (Using java.util)
Convert an Array to String in Java (Using java.util)

[crayon-5a2bbac51d48d115454609/] Discussion This example has been compiled with JDK 9 Output [crayon-5a2bbac51d497572618480/] We can see that type (class) of array...

Close