Is it possible to create an object for an interface? If yes, how is it done? According to my view the following code says that we can:
What you are seeing is an anonymous inner class.
it’s creating an instance of a new, anonymous,implementer of Runnable class.
Because an anonymous class definition is an expression, it must be part of a statement.