Static, non-static, final
Posted: Wed May 03, 2023 12:41 pm
i am having trouble with Static and non-static methods/variables.
please correct me if any of the below is wrong:
static variables can only be used in Static methods
non-static (instance) variables can be used in both Static and non-static methods
when final is assigned to a variable, the value became unchangeable. in this case, can it be used in both Static and non-static methods?
please correct me if any of the below is wrong:
static variables can only be used in Static methods
non-static (instance) variables can be used in both Static and non-static methods
when final is assigned to a variable, the value became unchangeable. in this case, can it be used in both Static and non-static methods?