Embed presentation
Download as PDF, PPTX












The document provides guidelines for naming conventions in Java including capitalization rules for class and method names, requirements for the main method, how to compile and run a Java program, that Java is case sensitive, naming the program file to match the class, identifiers in Java, Java keywords, single and multi-line comments, and blank lines. Key points covered include uppercase first letters for class names, lowercase first letters for method names, the main method must be public and static, and examples are provided for class and file names.
Classes should have upper camel case names like MyFirstJavaExample. Method names must start with a lowercase letter, exemplified by myMethodName.
A Java application contains a main method, which must be public and static for execution without an object.
To execute HelloWorld.java, compile it using 'javac HelloWorld.java' and run with 'java HelloWorld'.
Java is case-sensitive; 'HelloWorld' and 'helloworld' are different. Ensure correct casing in commands and file names.
The program file name must match the class name and end with '.java', e.g., 'HelloWorld.java'.
Identifiers are names for classes, variables, and methods. Java keywords like 'abstract' and 'class' are reserved and cannot be used.
Java supports single-line and multi-line comments, with all characters in comments ignored. Blank lines are also ignored.











