while studying init parameters concept in HF servlets and jsp i came across a stateement as follows
the one which is underlined .
i know we can call methods using class names like A.method() or using objects like a.method() the one which is underlined above is kind off confusing for me. does it mean a method calling a method??
help me out guys. thanks in advance
Moved to Beginning Java as this really has nothing to do with servlets.
That's just method chaining. The first method returns a reference to an object instance, and the second method is called on that object. That way, there is no need for a temporary variable to hold the object reference if it's not needed for anything else.
Joel Christophel wrote:In other words, getServletConfig() returns an object.
Actually it returns a reference to an object. Among experienced developers it's common to blur the distinction for brevity's sake, when we all know what we mean, but for beginners, it's best to keep that distinction explicit, as it can be the source of a lot of confusion and misconceptions.