It sounds easy but i've been trying to do it for quite sometime, I want to initialize my custom class object array using curly braces
Here is the failed example:
class:
class Tranforminfo{
int left;
int top;
int right;
int bottom;
float rorate;
public Tranforminfo(int left, int top, int right, int bottom, float rorate) {
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
this.rorate = rorate;
}
}
Usage: (not correct)
// attempt 1
Tranforminfo somedamn = new Tranforminfo[]{(1,2,3,4,5),(6,4,3,5,6)};
// attempt 2
Tranforminfo somedamn = new Tranforminfo[]{{1,2,3,4,5},{6,4,3,5,6}};
// attempt 3
Tranforminfo somedamn = new Tranforminfo[]((1,2,3,4,5),(6,4,3,5,6));
No luck so far help appreciated , i am coding in android(JAVA)