Hello All,
While I was going through the Online tutorial on
J2EE 1.4, I found the following piece of code, which confused me.
Create an initial naming context.
Context initial = new InitialContext();
Context myEnv = (Context)initial.lookup("java:comp/env");
The java:comp/env name is bound to the environment naming context of the ConverterClient component.
My question here is , initial.lookup() method would return an object of type Object class. How could we make a reference variable of type "Context" interface to refer the object of type "Object". I haven't seen anywhere Object implementing Context interface. What kind of
polymorphism is that? Or is that anything else. I'm very new to java/J2EE area and hence I'm not sure if I had mistaken that code.
Thanks in advance.