Java Basics
Java Basics
Java applications are typically compiled to bytecode that can run on any Java virtual
machine (JVM) regardless of the underlying computer architecture.
JVM, JRE & JDK
Java Virtual Machine: The Java Virtual Machine (JVM) is a virtual machine that
enables a computer to run Java programs as well as programs written in other
languages that are also compiled to Java bytecode.
Java Runtime Environment: The JRE provides the necessary resources for
executing Java programs on a computer. It ensures that your compiled Java code can
run smoothly.
Java Development Kit: The Java Development Kit (JDK) is a software development
kit used by Java developers to build, compile, debug, and deploy Java applications. It
includes a collection of tools, libraries, and components necessary for Java
development.
HELLO WORLD !
class HelloWorld {
System.out.println("Hello, World!");
Variables allow you to manipulate and work with values in your Java programs. Before using a
variable, you must declare it with a specific data type.
Data Types: Data types specify the kind of data that can be stored in a variable. Java has two
main categories of data types.
Reference Data Types: These include classes, interfaces, and arrays. They store references (memory
addresses) to objects rather than the actual data.
O P E R AT O R S
In Java, operators are symbols that perform various operations on variables and
values.
Unary Operators ( !, - )
C O N T R O L F L O W S TAT E M E N T S
In Java, control flow statements allow you to change the execution path of your
program based on certain conditions.
Default
Public
Private
Protected
CONSTRUCTOR METHOD & THIS
KEYWORD
“this” keyword: The “this” keyword in Java serves a fundamental purpose: it refers to
the current object. In other words, this represents the instance of the class where it’s
used.
O O P S C O N C E P T S I N J AVA
Class
Object
Inheritance
Polymorphism
Encapsulation
T H A N K YO U