• Steps to write the code
  • Select workspace
  • Workspace is the directory from where the file system. In that directory all the files for the project or application will be stored.
    Create a file with the name FirstExample.java using any text editor.
    Write the following code in the source file.
                                        
                                            class FirstExample {
                                                public static void main(String ankur[]){
                                                    System.out.print("Hello ");
                                                    System.out.println("world");
                                                }
                                            }
                                        
                                    
  • What are these?
    • class -> keyword
    • FirstExample -> our defined class name
    • public -> keyword
    • static -> keyword
    • void -> keyword
    • main -> predefined method name
    • String -> predefined class name
    • ankur -> our defined variable name
    • System.out.print -> It display the execution output in console. After displaying the message the cursor will be in same line.
    • System.out.println -> It display the execution output in console. After displaying the message the cursor will be in next line.
  • TODO

Comments