Is there a way of defining a class "on the fly"-- that is, instantiating an object without an explicit declaration of a class?
What i'm looking for is instantiating an object, using the constructor of Object maybe(?), and defining some members (2 literal variables) while doing that.
I need an object-- and one object of that type only-- of 2 literals as members. I don't want to define a class to do that. And, as far as i know, Java doesn't have some type like struct to do that.
I don't think Java does this-- but still.
Thanks in advance.
Note: i've seen Does Java support structs? and Struct like objects in Java.