I\'m Getting the \"non-static variable this cannot be referenced from a static context\" error when I try to add a new instance of the Edge class(subclass?) to my arraylist.
non-static variable this cannot be referenced from a static context"
this error indicate that you are accessing the variable which is not static without its object. to access the non static variable you need the object of that type. only static variables can be accessed without any object.
the solution is same as @dasblinkenlight provided.