Java Language

Java is a class-based, high-level, object-oriented programming language. It was developed by James Gosling(also known as the father of Java) and his colleagues in 1991 at Sun Microsystems(which is now a subsidiary of oracle).Java was initially called Oak. It was named after the oak trees outside Gosling's office. Sun Microsystems created the programming language java as a part of research work to develop software for consumer electronics. One of the most significant advantages of Java is platform independence. It has the capability of moving easily from one computer system to another. Java is popularly used in the console, GUI, web, game developments, to make Embedded Systems, etc. Being an object-oriented programming language, Java has adopted many features of C++.

What are the features of Java?

What are the applications of Java?

What is a Compiler and an interpreter?

The compiler of Java is a software that converts the code into a binary form called Byte. Code(a common binary form of the program which works irrespective of the machine). An interpreter is a computer program that accepts the byte code and converts it into machine code.

What is the difference between a Compiler and an Interpreter?

Compiler Interpreter
1) Compiler converts the whole program source into the object program at once. 1) Interpreter converts the source program one line at a time into the object program.
2) It shows all the errors in the program after the compilation. 2) It shows the errors one line at a time and after debugging that line it goes to the next line.

What are JVM, JRE, JDK?

JDK (Java Development Kit) is a software development environment that is used for developing Java applications and applets. It includes the Java Runtime Environment (JRE), an interpreter/loader (Java), a compiler (javac), an archiver (jar), a documentation generator (Javadoc), and other tools needed in Java development.
JRE(Java Runtime Environment) also known as Java RTE. JRE is used to provide the runtime environment and is used to develop Java applications. It is the implementation of JVM. The Difference between JRE and JVM is that JRE exists physically and JVM exists virtually. It contains a set of libraries and other files.
JVM(Java Virtual Machine ) is a machine that allows the computer to run programs written in Java and also in other programming languages that are compiled to Java byte code. It is known as a virtual machine because it does not exist physically. It is a part of the Java Runtime Environment(JRE).

Basic Structure of a Java program.

public class Main {
public static void main(String [ ] args) {
System.out.println( "Hello World" ) ;

What is a Variable in Java?

Variables are containers of data that store the data values during the time of java program execution. Every variable is assigned with a data type that classifies the type of value it holds. It is the name of the memory location of the particular data. It is also known as the basic unit of storage.

What are the types of variables?

There are three types of variables in Java:-

What are Data types in Java?

Data types define the values that a variable holds. It states the sizes, nature of the values that variables can store. It represents what operations can be performed on the particular data. Data types are the base of any programming language.

There are two types of data types in java:

1. Primitive Data Types - It includes char, boolean, byte, int, short, long, float, and double.
2. Non- Primitive Data Types - It includes Classes, Interfaces, and Arrays.

What are Primitive Data Types in Java?

These data types are already defined (predefined) in java. It states the size and type values in the variables. They are also known as the basic building blocks of data manipulation. Operations can also be performed by this data type. It has only single values with no special capabilities.

What are Non-Primitive Data Types in Java?

These data types are not defined by Java. They are called Reference data types because they cannot directly store the value of a variable in memory and they refer to objects. These are created by the programmer. They can be used to call methods in order to perform operations. They can also be null and always starts with an uppercase letter. Example- Strings, Arrays, Object, Classes, Interfaces.