NITCODE ACADEMY
“JAVA”
Network Information Security By Prof. Golandaj Sir’s ( NITCODE Academy, contact us:
+91- 8180959594, and download APP NITCODE Academy)
What is Java
Java is a class-based high-level object oriented programming language
developed by “James Gosling and his friends in 1991 by Sun Microsystems
Java follows the principle Write Once, Run Anywhere (WORA), which means a
Java program can run on any operating system having a Java Virtual Machine
(JVM).
Java programs are first compiled into bytecode, and then the JVM converts this
bytecode into machine code. Java is secure, robust and widely used for desktop,
web and Android applications.
Java 1.0 (1996) Java 1.0 was the first official version of Java. It introduced
the basic concepts of class, object and JVM.
Syntax:
Class class_name
public static void main(String argos[])
[Link](“ “);
NIS By Prof. Golandaj Sir’s ( NITCODE Academy, contact us: +91- 8180959594, and download APP NITCODE Academy)
2
1️⃣ Class Declaration
● Every Java program must contain at least one class.
● The class keyword is used to declare a class.
● The class name should start with a capital letter.
2️⃣ Curly Braces { }
● Curly braces define the beginning and end of a class or method.
3️⃣ public Keyword
● public is an access modifier.
● It allows the JVM to access the main method from anywhere.
4️⃣ static Keyword
● static means the method can be called without creating an object.
● JVM calls the main method directly using the class name.
NIS By Prof. Golandaj Sir’s ( NITCODE Academy, contact us: +91- 8180959594, and download APP NITCODE Academy)
3
5️⃣ void Keyword
● void specifies that the method does not return any value.
● The main method always has void return type.
6️⃣ main() Method
● main() is the entry point of a Java program.
● Program execution starts from the main method.
7️⃣ String[] args
● It is used to store command-line arguments.
● args is an array of String objects.
8️⃣ Statements
● Statements are instructions written inside the main method.
● Every statement must end with a semicolon (;).
🔹 Output Statement (Very Important)
NIS By Prof. Golandaj Sir’s ( NITCODE Academy, contact us: +91- 8180959594, and download APP NITCODE Academy)
4
[Link]("Hello Java");
● System is a predefined class.
● out is an output stream object.
● println() prints output and moves to a new line.
Note : Rules of Java Syntax
● Java is a case-sensitive language.
● The file name must match the class name.
● Each statement ends with a semicolon (;).
● Execution always starts from the main method.
NIS By Prof. Golandaj Sir’s ( NITCODE Academy, contact us: +91- 8180959594, and download APP NITCODE Academy)