Just like this..
I have a interface..
And then, I create a class implement InterfaceDemo interface.
last i
test it.
Result:
we can see,the console print two lines.
this is just like the servlet, when the containner startup, it can create the servlet instance, than run the HttpServlet service method, it didn't know what the implements is.Just run the interface methods...