Determine about the runtime Security Manager
Java also has a runtime Security Manager can check which operations a specific piece of code is allowed to do. Consequently, java can run un-trusted code in a "sandbox" where, for instance, it can draw to the screen however can't access local file system.