What is the time taken by java to call a method in another package?

Posted by satish on Stack Overflow See other posts from Stack Overflow or by satish
Published on 2010-12-30T06:37:32Z Indexed on 2010/12/30 6:54 UTC
Read the original article Hit count: 210

Filed under:

I have an assignment where i need to do feasibility study on two of my approaches and find optimized one.

There are two packages A and B User input is gathered in A and then sent to B for execution. Now my approaches are 1. Call B methods from package A one by one. 2. Create a common method in B and send all the input as parameters.

Which is feasible and best one, I know 2 is good in terms of code optimization and less number of calls. But, I want to understand what will be the execution time difference in above approaches How much time does java take to call method in another package? Is there any default value like x nano seconds or y milli seconds.

Based on the time taken I can choose the appropiate one.

Thanks

© Stack Overflow or respective owner

Related posts about java