Please find the attached screen shot.
InstructorYogesh Chawla Replied on 21/04/2020
Your program executed successfully with the correct output. This happened because we are using javaw.exe first instead of java.exe.
Set the environment variable in your windows as well.
You can follow these steps to set up environment variable.
Assuming you have installed Java in c:\Program Files\java\jdk directory −
Right-click on 'My Computer' and select 'Properties'.
Click the 'Environment variables' button under the 'Advanced' tab.
Now, alter the 'Path' variable so that it also contains the path to the Java executable. Example, if the path is currently set to 'C:\WINDOWS\SYSTEM32', then change your path to read 'C:\WINDOWS\SYSTEM32;c:\Program Files\java\jdk\bin'.