Basic Structure of a Java Program: Understanding our First Java Hello World Program


  • Basic Structure of a Java Program
package com.company; // Groups classes
public class Main{ // Entrypoint into the application
public static void main(String[]args){
System.out.println(Hello World);
}
}
  • Naming Conventions

For classes, we use Pascal Convention. First and Subsequent characters from a word are capital letters (uppercase)

      Example: Main, MyScanner, MyEmployee, CodeWithHarry


For functions and variables, we use camelCaseConvention. Here the first character is lowercase and the subsequent characters are uppercase like below:

      Main, myScanner, myMarks, CodeWithHarry



Aryadeep

Welcome to CodeWithARYA. It's My Personal Reference Website. Where You Can Get Amazing Codes. Have a Look.

Post a Comment

Previous Post Next Post