in JAVA by
Q:
What are static methods, static variables, and static blocks?

1 Answer

0 votes
by

What are static methods, static variables, and static blocks?

1) Static methods are methods that can be called directly inside a class without the use of an object.

2) Static variables are variables that are shared between all instances of a class.

3) Static blocks are code blocks that are loaded as the class is loaded in memory.

Related questions

0 votes
asked Dec 7, 2020 in JAVA by SakshiSharma
0 votes
asked Oct 13, 2020 in JAVA by SakshiSharma
0 votes
asked Oct 12, 2020 in JAVA by Robindeniel
...