1. Static variables:
Static or class variables are initialized when the class is loaded into the JVM. These static variables usually can be accessible without creating instance of a class. Mostly it is used to declare constant values.
2. Global variables:
AFAIK, java doesn’t support global variable but however you can declare variables as public which can be accessed by inside/outside classes/packages.
What is difference between static and global variable in java?

阅读 154
收藏 0
点赞 0
评论 0
评论列表
文章目录