Question: 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

Answer: 
You could make it a [nested class](http://download.oracle.com/javase/tutorial/java/javaOO/nested.html) if appropriate for your design.
You can make a class inside another class if you want to.

```
class Graph {

    class GraphicObject {
        Color color;
        double value;
        String name;

        // You can omit this, and treat it just like a struct if you want
        GraphicObject(Color c, Double b, String n) {
           // ...
        }
    }

    List<GraphicObject> myObjects();
    // other things about Graph here, as normal

}

```