0 votes
in JAVA by

Can static methods reference non-static variables?

1 Answer

0 votes
by

Can static methods reference non-static variables?

Yes, static methods can reference non-static variables. It can be done by creating an object of the class the variable belongs to.

Related questions

+1 vote
asked Jan 20, 2022 in JAVA by rajeshsharma
+1 vote
asked Dec 7, 2020 in JAVA by SakshiSharma
...