i have MyClass as
MyClass(String, String, int);
i know about how to add to add to ArrayList in this way:
MyClass.name = \"N
You can instantiate ArrayList like so:
new ArrayList() {{
add(new MyClass("Name", "Address", age));
}};
This creates an anonymous inner class that actually extends ArrayList, with an initialiser block that calls add. This is obviously completely filthy and will make your colleagues want to hurt you, so you should use Arrays.asList instead. :)