Why can multiple applets access one global class?

So I have a fairly complex applet structure from a couple years back, and I have a question about a global class that is in it. Basically, I have three applets on the same page and they interact with each other in different ways. The part I'm confused about is the fact that they all share global (static) variables from the same class. How exactly is this happening? I was under the impression that each applet would have its own little environment and would thus be unable to access the same static variables as the others? For example if I have this in applet A: Globals.globalVar = 5; And this in applet B: int x = Globals.globalVar; And I ensure that B starts AFTER A then x will become 5. I would like to know how exactly this is handled in the JVM, as it doesn't quite make any sense to me. Does this behaviour imply that if you have two separate java applications running at the same time they can access each others static variables? Thanks beforehand.

以上就是Why can multiple applets access one global class?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准