JAVA BASICS

Diwakar pratap
2 min readMar 21, 2022

· Java is a popular programming language, created in 1995.
· It is owned by Oracle, and more than 3 billion devices run Java.
· Java is a programming language and a platform.
· Java is a high level, robust, object-oriented and secure programming language

Application

· Mobile applications
· Desktop applications
· Web applications
· Web servers and application servers
· Games
· Database connection

Java Platform

Java Platform is a collection of programs. It helps to develop and run a program written in the Java programming language. Java Platform includes an execution engine, a compiler and set of libraries. Java is a platform-independent language.

There are 4 platforms or editions of Java:

1) Java SE (Java Standard Edition)
2) Java EE (Java Enterprise Edition)
3) Java ME (Java Micro Edition)
4) JavaFX

Syntax

public class Main
{

public static void main(String[] args)
{
System.out.println(“Hello World”);
}

}

Java Data Type

Data types are divided into two groups:

· Primitive data types
· Non-primitive data types

1. Primitive data types

i. Byte-1 byte
ii. short- 2 byte
iii. int- 4 byte
iv. long- 8 byte
v. float- 4 byte
vi. double- 8 byte
vii. boolean- 1 bit
viii. char- 2 byte

2. Non-primitive data types

i. String
ii. Arrays
iii. Classes

Java Operators

Java divides the operators into the following groups:

· Arithmetic operators
· Assignment operators
· Comparison operators
· Logical operators
· Bitwise operators

Reasons Why Java is used

· Java works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc.
· It is one of the most popular programming language in the world
· It is easy to learn and simple to use
· It is open-source and free
· It is secure, fast and powerful
· It has a huge community support (tens of millions of developers)
· Java is an object oriented language which gives a clear structure to programs and allows code to be reused, lowering development costs
· As Java is close to C++ and C#, it makes it easy for programmers to switch to Java or vice versa

--

--