As java is interpreted language
Pros:
- Compatibility: Java virtual machine approves this concept "Write once, run everywhere."
- Security: The program running in JVM so if any failure happens this not affects on operating systems files.
- Memory management.
Cons:
- Java virtual machine has many implementations, for example when writing a program that uses Java 8 features this program must run on JVM with 8 version not less.