Validating social security number java
The language is type-safe, and the runtime provides automatic memory management and bounds-checking on arrays.
Java programs and libraries check for illegal state at the earliest opportunity.
The most extreme form of this is known as the principle of least privilege.
Using the Java security mechanism this can be implemented statically by restricting permissions through policy files and dynamically with the use of the mechanism (see Section 9).
To minimize the likelihood of security vulnerabilities caused by programmer error, Java developers should adhere to recommended coding guidelines.
Existing publications, such as Effective Java , provide excellent guidelines related to Java software design.
For example, making a class final prevents a malicious subclass from adding finalizers, cloning, and overriding random methods (Guideline 4-5).
The Java language  and virtual machine  provide many features to mitigate common programming mistakes.If a sandboxed applet or application attempts to execute security-sensitive code, the JRE will throw a security exception.