0% found this document useful (0 votes)
2 views13 pages

Quick Summary

Java, developed by James Gosling in 1995 and acquired by Oracle, is a simple, platform-independent, object-oriented programming language used for various applications including Android and web development. Key features include robustness, security, and the ability to create distributed applications, with a development process that involves writing, compiling, and running programs using the Java Development Kit (JDK) and Java Virtual Machine (JVM). A simple Java program example is provided, demonstrating basic syntax and functionality.

Uploaded by

b4urudraksh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views13 pages

Quick Summary

Java, developed by James Gosling in 1995 and acquired by Oracle, is a simple, platform-independent, object-oriented programming language used for various applications including Android and web development. Key features include robustness, security, and the ability to create distributed applications, with a development process that involves writing, compiling, and running programs using the Java Development Kit (JDK) and Java Virtual Machine (JVM). A simple Java program example is provided, demonstrating basic syntax and functionality.

Uploaded by

b4urudraksh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

INTRODUCTION TO JAVA

• JAVA was developed by James Gosling at Sun


Microsystems Inc in the year 1995 and later acquired by
Oracle Corporation. It is a simple programming language. Java
makes writing, compiling, and debugging programming easy. It
helps to create reusable code and modular programs. Java is a
class-based, object-oriented programming language and is
designed to have as few implementation dependencies as
possible.
• This platform independent programming language is utilized
for Android development, web development, artificial
intelligence, cloud applications, and much more.
• Implementation of a Java application program involves a
following step. They include:
1. Creating the program
2. Compiling the program
3. Running the program
• Remember that, before we begin creating the program, the
Java Development Kit (JDK) must be properly installed on our
system and also path will be set.
Java Terminology
• 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 a java programmer like you and
me.
• The compilation is done by the JAVAC compiler which is a
primary Java compiler included in the Java development kit
(JDK). It takes the Java program as input and generates
bytecode as output.
• In the Running phase of a program, JVM executes the bytecode
generated by the compiler.
• The function of Java Virtual Machine is to execute the bytecode
produced by the compiler.
• Bytecode in the Development Process: As discussed, the 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.
• Java Runtime Environment (JRE): JDK includes JRE. JRE installation
on our computers allows the java program to run, however, we
cannot compile it. JRE includes a browser, JVM, applet support, and
plugins. For running the java program, a computer needs JRE.
Primary/Main Features of Java
1. Platform Independent: Compiler converts source code
to bytecode and then the JVM executes the bytecode
generated by the compiler. This bytecode can run on any
platform be it Windows, Linux, or macOS which means
if we compile a program on Windows, then we can run it
on Linux and vice versa. Each operating system has a
different JVM, but the output produced by all the OS is
the same after the execution of the bytecode. That is why
we call java a platform-independent language.
2. Object-Oriented Programming Language: Organizing
the program in the terms of a collection of objects is a
way of object-oriented programming, each of which
represents an instance of the class.
1. The four main concepts of Object-
Oriented programming are:
1. Abstraction
2. Encapsulation
3. Inheritance
4. Polymorphism

2. Simple: Java is one of the simple


languages as it does not have complex
features like pointers, operator
overloading, multiple inheritances, and
Explicit memory allocation.
Abstraction

Polymorphism
• 4. Robust: Java language is robust which means
reliable. It is developed in such a way that it puts a
lot of effort into checking errors as early as possible,
that is why the java compiler is able to detect even
those errors that are not easy to detect by another
programming language. The main features of java
that make it robust are garbage collection,
Exception Handling, and memory allocation.
• 5. Secure: In java, we don’t have pointers, so we
cannot access out-of-bound arrays i.e it
shows ArrayIndexOutOfBound Exception if we
try to do so. That’s why several security flaws like
stack corruption or buffer overflow are impossible
to exploit in Java. Also, java programs run in an
environment that is independent of the os(operating
system) environment which makes java programs
more secure.
6. Distributed: We can create distributed applications
using the java programming language. Remote Method
Invocation and Enterprise Java Beans are used for
creating distributed applications in java. The java
programs can be easily distributed on one or more
systems that are connected to each other through an
internet connection.
JAVA IDE
SIMPLE JAVA PROGRAM
// Importing classes from packages
import java.io.*;
// Main class
public class GFG {
// Main driver method
public static void main(String[] args)
{

// Print statement
System.out.println("Welcome to JAVA’S WORLD");
}
}

You might also like