- 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