+ 1

Can we declare the global variable in java?

if yes then how to do that?

2nd Jan 2017, 7:33 PM
Rishabh Sonkar
Rishabh Sonkar - avatar
2 Respostas
+ 1
no there are no global variable but we can use static variable as global variable
2nd Jan 2017, 7:36 PM
Ashwaghosh Sadanshiv
Ashwaghosh Sadanshiv - avatar
+ 1
use "static" keyword before type declaration of your variable
2nd Jan 2017, 9:10 PM
Nima Moradi
Nima Moradi - avatar