Java Essentials
Last updated
Last updated
JVM (Java Virtual Machine) is an abstract machine that enables your computer to run a Java program.
JRE (Java Runtime Environment) is a software package that provides Java class libraries, Java Virtual Machine (JVM), and other components that are required to run Java applications.
JDK (Java Development Kit) is a software development kit required to develop applications in Java. When you download JDK, JRE is also downloaded with it.
JDK (Java Development Kit) is a software development kit required to develop applications in Java. When you download JDK, JRE is also downloaded with it.
In addition to JRE, JDK also contains a number of development tools (compilers, JavaDoc, Java Debugger, etc).
If you want to develop Java applications, download JDK.
Operators in Java can be classified into 5 types:
Arithmetic Operators
Assignment Operators
Relational Operators
Logical Operators
Unary Operators
Bitwise Operators
+
Addition
-
Subtraction
*
Multiplication
/
Division
%
Modulo Operation (Remainder after division)
~
Bitwise Complement
<<
Left Shift
>>
Right Shift
>>>
Unsigned Right Shift
&
Bitwise AND
^
Bitwise exclusive OR
+
Unary plus: not necessary to use since numbers are positive without using it
-
Unary minus: inverts the sign of an expression
++
Increment operator: increments value by 1
--
Decrement operator: decrements value by 1
!
Logical complement operator: inverts the value of a boolean
=
a = b;
a = b;
+=
a += b;
a = a + b;
-=
a -= b;
a = a - b;
*=
a *= b;
a = a * b;
/=
a /= b;
a = a / b;
%=
a %= b;
a = a % b;
=
a = b;
a = b;
+=
a += b;
a = a + b;
-=
a -= b;
a = a - b;
*=
a *= b;
a = a * b;
/=
a /= b;
a = a / b;
%=
a %= b;
a = a % b;
&&
(Logical AND)
expression1 && expression2
true
only if both expression1 and expression2 are true
||
(Logical OR)
expression1 || expression2
true
if either expression1 or expression2 is true
!
(Logical NOT)
!expression
true
if expression is false
and vice versa
~
Bitwise Complement
<<
Left Shift
>>
Right Shift
>>>
Unsigned Right Shift
&
Bitwise AND
^
Bitwise exclusive OR
How the if...else statement works?
Output
Working of Java continue statement
Java continue with Nested Loop.
Here, we have created a multidimensional array named a. It is a 2-dimensional array, that can hold a maximum of 12 elements,