Search This Blog

Java : Fundamental Question and Answer

To address the issues of portability and security, why was it necessary to create a
new computer language such as Java; couldn’t a language like C++ be adapted? In
other words, couldn’t a C++ compiler that outputs bytecode be created?


While it would be possible for a C++ compiler to generate bytecode rather than
executable code, C++ has features that discourage its use for the creation of
applets—the most important feature being C++’s support for pointers. A pointer is the
address of some object stored in memory. Using a pointer, it would be possible to access resources outside the program itself, resulting in a security breach. Java does not support pointers, thus eliminating this problem