1.No use of pointers
C/C++ language uses pointers, which
may cause unauthorized access to memory blocks when other programs get the
pointer values. Unlike conventional C/C++ language, Java never uses any kind of
pointers. Java has its internal mechanism for memory management. It only gives
access to the data to the program if has appropriate verified authorization.
2.Byte code is the thing that
makes Java more secure
Every time when a user compiles the
Java program, the Java compiler creates a class file with Bytecode, which are
tested by the JVM at the time of program execution for viruses and other
malicious files.
1
no readability i.e., contains byte code
understandable to only JVM.No virus will infect the byte code. Even if the virus entered into byte code
the jvm doesn't understand it, so jvm keeps these instructions as it is. No
executable code will be generated to this virus.