posted 4 years ago
In Java, String comparison must be done with the .equals method rather than the == operator, because the == operator compares addresses only, not contents
Also, it doesn't look like you are accepting an input value for "amPm" anywhere as you are in this C++ code:
In Java, the main method has no return value ("void"), unlike C++ where you return an int.