I usually make the classes for everything usually to combine several types together.
For example for combining int and double
public class IntAndDouble{
public final int INT;
public final double DOUBLE;
public IntAndDouble(int i,double d){INT = i; DOUBLE = d;}
}
pretty much like creating oftentimes a small struct
.
But I've noticed that for every small class like this, there is a ~1KB (300-1000 bytes) file in the jar
And when creating 10-15 of these small classes there can be an increase of ~30KB in the jar
This wouldn't be a problem in real Java where 30KB is nearly negligible,
but in J2ME where a regular app is usually around 200KB, 30KB is a huge significance.
What is the best way to make a 'small struct' in J2ME?