Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

JVM enforces the rule...

Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While preparing for the SCJP exam, I come across the statement in various situations:
"Be careful not every JVM enforces the rule... "
What does that implys? Why people make such difference between the different versions of JVM?
Any ideas? Thanks.
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JVM is just a piece of software like any other designed to be an interface between the code you write and the computer hardware. While all the JVMs are meant to follow certain rules in their interpretation of the Java language so as to meet the write once run everywhere idea, certain things are still left up to the jvm designers, such as how and when the garbage collector runs, or in deciding how different threads to share the cpu's time.
Hope that short explanation cleared it up for you.
Author and all-around good cowpoke
Posts: 13078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A corollary would be "a Java compiler may not catch all incorrect uses of modifiers" - for example, at one time you could declare a class with the "synchronized" modifier without getting a compiler error. I have not tried that with recent compilers.
Squanch that. And squanch this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic