Interview Experience 22/03/2022

1. Tell me about yourself, your strengths, weaknesses, and your long-term goal?


2. What is the diff between static variable and final variable?

static variable:

if we declared any variable with a static keyword called a static variable.

These variables are also called class-level variables.

The static keyword belongs to the class than an instance of the class.

It is used for memory management.





Java static property is shared with all objects.

Also, we can use static keywords with variables, methods, blocks, and nested classes.



Final Variable

The variable declared with the final variable is called a final variable.

The final keyword is a non-access specifier that is used to restrict a class, variable, and method. If we initialize a variable with the final keyword, then we cannot modify its value.


If we declare a method as final, then it cannot be overridden by any subclasses. 


And, if we declare a class as final, we restrict the other classes to inherit or extend it.


In other words, the final classes can not be inherited by other classes.