In c++, one could simply do something like this:
struct GraphObject {
Color color;
double value;
String name;
};
However in Java, I can’t simply do this, I only see creating a class just for this as an option. What I do not like about that is then I need to drag around GraphObject.java and Graph.java (since Graph will hold an ArrayList of GraphObject. Is there a way to put the object class in with Graph.java or is this simply impossible/bad practice?
Thanks
You could make it a nested class if appropriate for your design.