Global variables in Java

后端 未结 24 2124
青春惊慌失措
青春惊慌失措 2020-11-22 11:56

How do you define Global variables in Java ?

24条回答
  •  眼角桃花
    2020-11-22 12:28

    In general, Java doesn't have any global variables. Other than local variables, all variables comes under the scope of any class defined in the program. We can have static variables to have the scope of global variables.

提交回复
热议问题