You do not say how you obtained this string; I recommend giving us code, hopefully running code, so we can see how it is obtained. It appears to be a string returned from an array of Object.
In other words, an Object[]. You can tell quite easily: the starting [ indicates it's an array. The following is the element type name: an L to indicate it's an object type, followed by the fully qualified class name and a ;. For example, [Ljava.lang.String; indicates a String[].
Instead of an L followed by the class name and a ;, you can also get one of these:
- B for byte
- S for short
- I for int
- J for long (L is taken)
- F for float
- D for double
- C for char
- Z for boolean (B is taken)
So, if you ever see [I, that indicates an int[].
To go one step further, if you encounter multiple occurrences of [ that means that you get an array of an array (of an array etc):
- [I indicates int[]
- [[I indicates int[][]
- [[[I indicates int[][][]
Are you sure the contents are instances of either int[] or String[]? If it's an Object[], instanceof String[] will return false even if all elements are Strings.
In fact, I would change the method. Create a new class (PaymentDetails or something) that has fields that coincide with the two ints and the String. Then let the method create a List of this class (e.g. List<PaymentDetails>). The loop will create one instance of this class for each row.
Are you using Hibernate or some other ORM framework? What does the method getLastPaymentData of the DAO return exactly? Apparently it's not a list of TransportPaymentEntity objects.
Quite possibly because you've made it difficult to read.
Please don't put enormously long lines inside code blocks; it screws up the windowing.
In fact, I suggest you read the UseCodeTags page again. Thoroughly.
Jesper de Jong, yes i am using hibernate. getLastPaymentData() returns a list. As i have said, in this method, i am passing a SQL query, and it fetches me value of property of TransportPayementEntity. I can get those values by number of if conditions ,(using instance of Integer,or string). But, that seems very odd.