1.java Intro

You might also like

Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 3

JAVA - Intro:

· Java is a general-purpose, class-based, object-oriented


programming language.
· It is a computing platform for application development. Java is
fast, secure, and reliable, therefore.
· Here are some important Java applications:
1. It is used for developing Android Apps
2. Helps you to create Enterprise Software
3. Wide range of Mobile java Applications
4. Scientific Computing Applications
5. Use for Big Data Analytics
6. Java Programming of Hardware devices
7. Used for Server-Side Technologies like Apache, JBoss, GlassFish,
etc.

Java Platform :
· Java Platform is a collection of programs that help programmers to
develop and run Java programming applications efficiently.
· It includes an execution engine, a compiler, and a set of libraries in
it. It is a set of computer software and specifications.
· James Gosling developed the Java platform at Sun Microsystems,
and the Oracle Corporation later acquired it.

Java Features:
· It is one of the easy-to-use programming languages to learn.
· Write code once and run it on almost any computing platform.
· Java is platform-independent. Some programs developed in one
machine can be executed in another machine.
· It is designed for building object-oriented applications.
· It is a multithreaded language with automatic memory
management.
· It is created for the distributed environment of the Internet.
· Facilitates distributed computing as its network-centric.
Java Terminology:

1. Java Virtual Machine(JVM):


This is generally referred to as JVM. There are three execution phases of
a program. They are written, compile and run the program.
· Writing a program is done by java programmer like you and me.
· The compilation is done by JAVAC compiler which is a primary Java
compiler included in the Java development kit (JDK).
It takes Java program as input and generates bytecode as output.
· In Running phase of a program, JVM executes the bytecode
generated by the compiler.

Now, we understood that the function of Java Virtual Machine is


to execute the bytecode produced by the compiler.
Every Operating System has different JVM but the output they produce
after the execution of bytecode is the same across all the operating
systems.
This is why Java is known as a platform-independent language.

2. Bytecode in the Development process:


· As discussed, Javac compiler of JDK compiles the java source code
into bytecode so that it can be executed by JVM.
· It is saved as .class file by the compiler.
· To view the bytecode, a disassembler like javap can be used.

3. Java Development Kit(JDK):


· JDK is a complete java development kit that includes everything
including compiler, Java Runtime Environment (JRE), java
debuggers, java docs etc.
· For the program to execute in java, we need to install JDK in our
computer in order to create, compile and run the java program.
4. Java Runtime Environment (JRE):
· JDK includes JRE. JRE installation on our computers allow the java
program to run, however, we cannot compile it.
· JRE includes a browser, JVM, applet supports and plugins. For
running the java program, a computer needs JRE.

5. Garbage Collector:
· In Java, programmers can’t delete the objects. To delete or
recollect that memory JVM has a program called Garbage
Collector.
· Garbage Collector can recollect the of objects that are not
referenced. So Java makes the life of a programmer easy by
handling memory management.

6. ClassPath:
· The classpath is the file path where the java runtime and Java
compiler looks for .class files to load.
· By default, JDK provides many libraries. If you want to include
external libraries they should be added to the classpath.

Example Program:

// Basic java program


import java.io.*;

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

You might also like