I guess for most purposes I'd recommend using a List of Lists ( List>) and avoiding arrays altogether, but I can't be sure whether that would be suitable for your purposes. You're already using class to perform the construction, and you're building a. Those bits are necessary to specify the element type of the arrays, if for no other reason.Īlso, I know there has to be a Java subclass to import or a more semantic approach. I speculate that in your attempt(s), you omitted the new String bits that make those constructors. Note in particular that Java has no array literals, only array initializers (which can be associated with array declarations), and array constructors, such as in the above code. Mutually comparable (that is, e1.In order to transform a two-dimensional array E into a two-dimensional List>, you can use the following code (look below for an explanation): public final String pocketArray = , Furthermore, all elements in the array must be Sorts the specified array of objects into ascending order, accordingĪll elements in the array must implement the Comparable
0 Comments
Leave a Reply. |