Can i know the real time example for Static method and final variables with defenition? Thank you!
Static method is the method which belongs to the class and not to the object(instance).
1)A static method can access only static data. It can not access non-static data (instance variables).
2)A static method can call only other static methods and can not call a non-static method from it.
3)A static method can be accessed directly by the class name and doesn√?¬Ę√Ę?¬¨√Ę?¬Ęt need any object.
4)A static method cannot refer to "this" or "super" keywords in anyway.
Final variables are the variables that cannot be modified. They are constants. They should be initialized either when they are defined or in constructor. Once initialized their value cannot be changed.
For more information, visit the following link:
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.