Oct
23
|
Arrays in Java are actually Objects and sometimes we need to get the Class instance for an array object. An example would be when using reflection to get a method that takes an array as an argument.
Here’s an example for getting the Class instance for a string array.
Class arrayClass = String[].class;
Leave a Reply
You must be logged in to post a comment.