0

what is the difference between final and static keywords

8th Sep 2016, 2:22 PM
Mokshal Shah
3 odpowiedzi
+ 1
static means that the element can be used without instanciating an object of the class first. final means that the value of the element cannot be modified, it's how you declare constants. If that element is a method, you cannot override it.
8th Sep 2016, 2:37 PM
Zen
Zen - avatar
0
Final means you cannot create subclasses of that class. Static variable of a class means there is only one variable shared btw all the objects of that class
23rd Oct 2016, 5:58 PM
Mansi Verma
Mansi Verma - avatar
0
static is shared throughout classes and sub classes and its can be changed, where final can be used throughout classes and subclasses and cannot be changed
10th Nov 2016, 10:57 PM
Mel Clarke
Mel Clarke - avatar