Type 'javac MyFirstJavaProgram. java' and press enter to compile your code. If there are no errors in your code, the command prompt will take you to the next line (Assumption: The path variable is set). Now, type ' java MyFirstJavaProgram ' to run your program.
A class is a template or blueprint from which objects are created. So, an object is the instance(result) of a class. Object Definitions: An object is a real-world entity. An object is a runtime entity.