Write steps required to code a java program on the computer.
Advertisements
Question
Write steps required to code a java program on the computer.
Very Long Answer
Advertisements
Solution
- Install Java Development Kit (JDK): Install the JDK on the computer to compile and execute Java programs.
- Open a Text Editor: Open a text editor such as Notepad or a Java IDE to write the program.
- Write the Java Program: Type the Java program using proper syntax, class declaration and the
main()method. - Save the Program: Save the program with the
.javaextension. The filename should match the public class name, if one is declared. - Compile the Program: Open Command Prompt and type
javac Filename.javato compile the program and check for errors. - Correct the Errors: If compilation errors occur, correct them and compile the program again.
- Execute the Program: Type
java ClassNamein Command Prompt to run the compiled program. - Check the Output: Observe the output displayed on the screen and verify the results.
shaalaa.com
Is there an error in this question or solution?
