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
.
More Related Contents:
- Java: Best way to iterate through a Collection (here ArrayList)
- Colorize logs in eclipse console
- How to execute logic on Optional if not present?
- Hash : How does it work internally?
- H2 database error: Database may be already in use: “Locked by another process”
- How Best to Compare Two Collections in Java and Act on Them?
- Sorting a List in parallel without creating a temporary array in Java 8
- In Java why this error: ‘attribute value must be constant’?
- How to manually deploy a web service on Tomcat 6?
- Sync version of async method
- Spring @RequestBody containing a list of different types (but same interface)
- Autowire a bean within Spring’s Java configuration
- How does this Java regex detect palindromes?
- Java: How do I know which jar file to use given a class name?
- Usage of inner class
- Do unclosed streams cause memory leaks in java?
- ElementType.LOCAL_VARIABLE annotation type
- How can I properly center a JPanel ( FIXED SIZE ) inside a JFrame?
- Find elements surrounding an element in an array
- How to enable CDI inject in web service (jaxrs/jersey) on java se running grizzly?
- Handling errors in ANTLR4
- Remove object from ArrayList with some Object property
- Firebase cloud messaging rest API spring
- How to send post request with x-www-form-urlencoded body
- BroadcastReceiver Vs WakefulBroadcastReceiver
- Immutable @ConfigurationProperties
- Javafx 2 click and double click
- Is it possible to have multiple PropertyPlaceHolderConfigurer in my applicationContext?
- How to correctly compute the length of a String in Java?
- Do not request Window.FEATURE_ACTION_BAR issue