Write a Java program to check whether Java is installed on your computer or not

Source Code:

public class P9 {
public static void main(String[] args) {
System.out.println(System.getProperty(“java.version”));
}
}

Output: