Basic difference between static and final keyword

What is the basic difference between static and final keyword in JAVA OOP language??

  • Rahul
  • 24 Jul 2018
  • 872 Views
  • 2 Answers
Your Answer

Static keyword-
Static keyword is applicable to nested static class, variables, methods and block.It is not compulsory to initialize the static variable at the time of its declaration.The static variable can be reinitialized.Static methods can only access the static members of the class, and can only be called by other static methods.Static class's object can not be created, and it only contains static members only.Static block is used to initialize the static variables.
Final keyword-
Final keyword is applicable to class, methods and variables.It is compulsory to initialize the final variable at the time of its declaration.The final variable can not be reinitialized.Final methods can not be inherited.Final methods can not be inherited.​Final keyword supports no such block.

Object Oriented Programming

Didn't get the answer.
Contact people of Talent-Object Oriented Programming directly by clicking here