Java “Hello, World!” Program
Operators In Java
The vast majority of the significant subjects have been covered that is nearly asked in every one of the meetings, so set up this multitude of ideas well. Good luck for you Meetings
Q. 1. What are closures? Advantage and Disadvantage
Conclusion is a mix of capabilities packaged together in a lexical extension. The inward capability approaches an external capability degree, factors and boundaries even after the external capability has returned.
Advantages of closures: 1.
2. Mostly used in Encapsulation of the code
3. Also used in creating API calling wrapper methods
Disadvantages of closures:
1. Variables used by closure will not be garbage collected
2. Memory snapshot of the application will be increased if closures are not used properly
Q. 2. Difference between regular function vs arrow function?
- Syntax – No implicit return for arrow function
- Argument Binding – In regular function, Arguments keywords can be used to access the arguments of which passed to function.
3. this keyword – Normal function depends on how it is being called and arrow function is on where it is being called.
4. New keyword – Regular functions are constructible, they can be called using the new keyword
5. Function Hoisting – In regular function, function gets hoisting at top.
Q. 3. What is Lexical Environment / lexical Scope?
Lexical perusing implies that the availability of not set in stone by the place of the factors inside the settled extensions.
Simpler, the lexical scoping means that inside the inner scope you can access variables of outer scopes.
More questions Updates Please Subscribe and Join Us