Introduction To Java
Introduction To Java
Introduction To Java
Topperworld.in
Introduction to java
©Topperworld
Java Programming
©Topperworld
Java Programming
3. Simple
The fact that we don’t have access to pointers in Java makes it incredibly safe.
It is impossible for problems like buffer overflow or stack corruption to arise
because we cannot access external arrays due to the lack of pointers.
5. Robust
6. High Performance
©Topperworld
Java Programming
7. Sandbox Execution
Let’s try to understand the various terms frequently used in Java and how the
code in Java is executed. The flow chart given below shows how a Java
program is executed.
©Topperworld
Java Programming
JVM is the common name for this. Program execution is divided into three
stages. The program is written, compiled, and executed.
As the name implies, Java Development Kit is a full-time kit that includes a
compiler, Java Runtime Environment (JRE), Debuggers, and Java
documentation. We must have JDK installed on our computers in order to
create, compile, and run the Java program.
©Topperworld
Java Programming
The Java Development Kit (JDK) includes the Java Runtime Environment (JRE).
Installing JRE on a computer enables the execution of Java programs, but does
not provide the ability to compile them. JRE includes JVM, a browser, applet
support, and plugins that are necessary for running Java applications. As a
result, having JRE installed on a computer is required in order to run Java
programs.
©Topperworld
Java Programming
To run Java Code on your device, you must install the Java Development Kit
(JDK) on your Windows computer.
Program:
// Main class
public class Topperworld {
public static void main(String[] args)
{
// Print statement
System.out.println("Welcome to Topperworld");
}
}
©Topperworld
Java Programming
Explanation:
1. Comments:- Comments are used to explain code and are used similarly
in Java, C, and C++. Compilers ignore comment entries and do not execute
them. Comments might be on a single line or multiple lines.
Syntax
3. Class:- In Java, a class is a container that holds data and functions for a
program. The behaviour of the class is defined by its functions. The class
named Topperworld has only one function, “Main”.
5. Void:- This keyword denotes that the method will not return anything.
©Topperworld
Java Programming
©Topperworld