top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

I have an object in Java, I want to know whether it is an array or not. How can I find?

0 votes
397 views
I have an object in Java, I want to know whether it is an array or not. How can I find?
posted Nov 23, 2015 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

you can use class.isArray() method to check whether object is array or not.

public static boolean isArray(Object obj)
{
    return obj!=null && obj.getClass().isArray();
}
answer Mar 14, 2016 by Shivam Kumar Pandey
Similar Questions
0 votes

Hi,Recently I made an app which takes photo and set to an ImageView in android.In samsung phone its orientation is 90 while camera intent opens so I used ExifInterface with four case 90/180/270/0 with normal case (0 degree) but when I compiled this method,its working perfect in all samsung device which is setting image after reverse rotate 90 to ImageView but not with others like moto/redmi/asus/karbonn I checked on each phone and there is an error that they are not getting bitmap.but when I removed ExifInterface and orientation,it started to work with all devices.but same issue with samsung device that setting image in ImageView with 90 degree orientation.
So I decided to use switch for samsung and other device so how can I know whether app is installed in samsung device or others using java?

...