Syntax of Java
Java
/*package whatever //do not write package name here */ import java.io.*; class GFG { public static void main (String[] args) { System.out.println( "GFG!" ); } } |
Explanation:
- Class Declaration: The program begins with the declaration of a class named GFG using the class keyword.
- main Method: The main method is the entry point of a Java application.
- Print Statement: The System.out.println statement is used to print a line to the console.
Output
GFG!
Java File Format | .java Extension
Java is a high-level, object-oriented programming language. A source code file written in the Java programming language is saved with the extension .java. .Java file extension typically contains Java code that can be compiled into bytecode and executed on the Java Virtual Machine (JVM). The Sun microsystem developed it. It is a platform-independent programming language. It is used to develop Android applications, web applications, artificial intelligence, cloud applications, and much more.
Table of Content
- Brief History
- Features of the java
- Syntax of Java
- Advantages of Java
- Disadvantages of Java
- Conclusion