Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The JVM "verifier" checks the code when it is loaded to verify
#1
Robust / Secure / Safe
• Java is very robust
o Both, vs. unintentional errors and vs. malicious code such as viruses.
o Java has slightly worse performance since it does all this checking. (Or put the other way, C can be faster since it doesn't check anything.)
• The JVM "verifier" checks the code when it is loaded to verify that it has the correct structure -- that it does not use an uninitialized pointer, or mix int and pointer types. This is one-time "static" analysis -- checking that the code has the correct structure without running it.
• The JVM also does "dynamic" checking at runtime for certain operations, such as pointer and array access, to make sure they are touching only the memory they should. You will write code that runs into
• As a result, many common bugs and security problems (e.g. "buffer overflow") are not possible in java. The checks also make it easier to find many common bugs easy, since they are caught by the runtime checker.
• You will generally never write code that fails the verifier, since your compiler is smart enough to only generate correct code. You will write code that runs into the runtime checks all the time as you debug -- array out of bounds, null pointer.
• Java also has a runtime Security Manager can check which operations a particular piece of code is allowed to do. As a result, java can run un-trusted code in a "sandbox" where, for example, it can draw to the screen but cannot access the local file system.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Proplem in code .help please Vuhelper 0 825 06-12-2011, 07:30 PM
Last Post: Vuhelper
  need java source code moon13 3 2,255 04-25-2011, 01:22 PM
Last Post: Xpert
  Print function java code 2011 saneha 0 1,174 04-24-2011, 10:10 PM
Last Post: saneha
  java correct code 2011 saneha 0 3,191 04-24-2011, 10:08 PM
Last Post: saneha
  error code in java saneha 1 1,220 04-24-2011, 10:04 PM
Last Post: saneha
  little error in java code saneha 1 1,054 04-24-2011, 09:44 PM
Last Post: Vuhelper
  need guidness in java code saneha 1 1,978 04-24-2011, 09:41 PM
Last Post: Vuhelper
  how can we run the java code ? after saving the file how run it? saneha 1 5,572 04-24-2011, 06:48 PM
Last Post: Vuhelper
  native code in java saneha 1 2,656 04-24-2011, 05:46 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)