Search Interview Questions | ![]() ![]() Click here and help us by providing the answer. ![]() Click Correct / Improve and please let us know. |
|
| ||||
Core Java - Interview Questions and Answers for 'Inline methods' - 2 question(s) found - Order By Newest | ||||
| ||||
Ans. Inline functions , just like C++ Macros is an optimized technique used by compiler to reduce the execution time. If the function is working on pre identified values ( which aren't resolved at runtime ), the function can execute the method and evaluate the outcome at compile time only instead of making a function call at runtime. In Java, the optimizations are usually done at the runtime or JVM level. At runtime, the JVM perform some analysis to determine which methods to inline. Java compiler would never inline any method and there is no way in java for the developer to explicitly define inlining of methods as it's take intrinsically care of during runtime only. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() 1. void method(int... x){}; 2. void method(int.. x){}; 3. void method(int.. .x){}; 4. void method(int ...x){}; 5. void method(int... x){}; 6. void method(int ... x){}; 7. void method(int x, int... y){}; 8. void method(int... x, int y){}; 9. void method(int... x,int... y){}; | ||||
![]() a. Methods , Variables and Initialization Blocks. b. Methods , Variables , Initialization Blocks and Outer Classes and nested Classes. c. Methods , Variables , Initialization Blocks and Outer Classes. d. Methods , Variables , Initialization Blocks and nested Classes | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() | ||||
![]() private static void method(String[] arg) and private static void method(String... arg) | ||||
![]() | ||||
| ||||
Ans. Inline functions , just like C++ Macros is an optimized technique used by compiler to reduce the execution time. If the function is working on pre identified values ( which aren't resolved at runtime ), the function can execute the method and evaluate the outcome at compile time only instead of making a function call at runtime. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
![]() | ||||
![]() | ||||