public static void main(String args[]) { call(10); } }
how does parameter in the method call, provide exchange of information between the caller object and callee object. which is the caller object and callee object. there is no object instantiation what aobjects are this. Is method invoked on the object or the object is invoked on the method.please help, thanks.
Hi Prashant, In this eg, since u r communicating between static methods, u wouldn't need an object (i.e. an instance of a class) to do the job. Static methods/variables are class level - meaning a single copy of these variables exists for the class rather than for every instance of the class. The parameter's major role beside carrying the requisite information to the method, is also to help in choosing the appropriate method in case of method overloading. An object invokes a method - not the other way around. A method is called by an object. There is nothing like a caller object and a callee object in your eg, - since ur calling a static method(call) from another static method(main) within the same class, u can call the method directly. eskay !