Just write
Class ofArray = o.getClass().getComponentType();
From the JavaDoc:
public Class<?> getComponentType()
Returns the
Class
representing the component type of an array. If this class does not represent an array class this method returnsnull
.
Related Contents:
- Android, getting resource ID from string?
- Array of JSON Object to Java POJO
- Re-paint on translucent frame/panel/component.
- How to count the number of documents under a collection in Firestore?
- “Integer number too large” error message for 600851475143
- Can’t compile project when I’m using Lombok under IntelliJ IDEA
- explicit casting from super class to subclass
- Natural sort order string comparison in Java – is one built in? [duplicate]
- Drawing a rectangle that won’t disappear in next paint
- Try With Resources vs Try-Catch [duplicate]
- How to create a Multidimensional ArrayList in Java?
- Using Selenium WebDriver to retrieve the value of an HTML input
- Java project in Eclipse: The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- How can I check whether an array is null / empty?
- Builder Pattern in Effective Java
- Calculate distance in meters when you know longitude and latitude in java [duplicate]
- What’s up with Java’s “%n” in printf?
- Testing Private method using mockito
- Drawing in JLayeredPane over exising JPanels
- Java – swing listen an action in a text field of a form
- Split regex to extract Strings of contiguous characters
- Extract string between two strings in java
- Java, How do I get current index/key in “for each” loop [duplicate]
- Get name of currently executing test in JUnit 4
- How can I create table using ASCII in a console?
- What is an automatic module?
- is memory leak? why java.lang.ref.Finalizer eat so much memory
- How to Serialize a list in java?
- Get first date of current month in java
- Is spring default scope singleton or not?
- Joda-Time: what’s the difference between Period, Interval and Duration?
- Difference between Static and final?
- How to deal with the URISyntaxException
- Howto get rid of ?
- pass array to oracle procedure
- Regex pattern including all special characters
- Why does Java’s Date.getYear() return 111 instead of 2011?
- How do I create a jagged 2d array in Java?
- What is the equivalent of Java static final fields in Kotlin?
- What is difference between Errors and Exceptions? [duplicate]
- What is a stack map frame
- Unable to complete the scan for annotations for web application [/app] due to a StackOverflowError
- Remove object from ArrayList with some Object property
- Java ‘+’ operator between Arithmetic Add & String concatenation? [duplicate]
- Read resource text file to String in Java [closed]
- Android flood-fill algorithm [closed]
- What are java object fields initialized with?
- Best way for automatic databinding between database and user interface in java swing app?
- Is it ok by REST to return content after POST?
- Parse JSON object with string and value only