0% found this document useful (0 votes)
62 views

L1 1. Introduction To Java PDF

The document provides an introduction to the Java programming language. It discusses Java's history and overview, including how it was created by James Gosling in 1991 and renamed from Oak to Java. It then covers why Java is popular due to being platform independent, and lists some of Java's key features such as being simple, secure, portable, robust, and object-oriented. The document also describes how the Java Virtual Machine (JVM) works and provides an example of a simple "Hello World" Java application.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

L1 1. Introduction To Java PDF

The document provides an introduction to the Java programming language. It discusses Java's history and overview, including how it was created by James Gosling in 1991 and renamed from Oak to Java. It then covers why Java is popular due to being platform independent, and lists some of Java's key features such as being simple, secure, portable, robust, and object-oriented. The document also describes how the Java Virtual Machine (JVM) works and provides an example of a simple "Hello World" Java application.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Chapter

1 INTRODUCTION TO JAVA

1.1. Java – Overview


Java is a programming language. Java is a high level, robust, object-oriented
and secure programming language. Java is used to develop mobile apps, web
apps, desktop apps, games and many more. According to Oracle, the company
that owns Java, Java runs on 3 billion devices worldwide, which makes Java
one of the most popular programming languages.
It is used for:
• Desktop applications
• Web applications
• Mobile Application
• Embedded Systems
• Robotics
• Payment Gateway Integration
• Web servers and application servers
• Games
• Database connection
• And much, many more!

1.2. History of Java


It was created by James Gosling, a Software Developer at Sun Microsystems,
in 1991. It was first called as Oak, which was later renamed as Java in 1995.
Why they rename Java, because James want unique name and Oak is already
trademark of Oak Technology and Oak Technology established in 1987, this
is the reason they renamed as Java. But why Java and symbol is coffee cup?
Answer- At the time of Development James Team want some refreshment
and they are using coffee for refreshment and this coffee comes from Iceland
country, Java city. This is the reason they choose name as a Java and symbol
as a Coffee Cup.

1.3. Why Java


One of the biggest reasons why Java is so popular because Java is a platform
independent. Programs can run on several different types of computer; as long
as the computer has a Java Runtime Environment (JRE) installed, a Java
program can run on it.
FULL STACK JAVA DEVELOPER 1
Most types of computers will be compatible with a JRE including PCs
running on Windows, Macintosh computers, Sun Solaris, Unix or Linux
computers, and large mainframe computers, as well as mobile phones.
Since it has been around for so long, some of the biggest organizations in the
world are built using the language. Many banks, retailers, insurance
companies, utilities, and manufacturers all use Java.
Java is a relevant programming language that shows no sign of declining in
popularity and, for that reason, is worth learning. Most developers pick it up
as their first programming language because it’s reasonably easy to learn.

1.4. Java Features


Java is a platform independent, simple, secure, portable, robust,
multithreading, distributed, Architecture-neutral, High Performance,
dynamic, Object oriented programming language. It is created to meet the real
world requirements.

1. Platform Independent
It is one of the best features of Java as it is the first programming language
that is not depends on Operating System. In other words, WORA- Write
once Run anywhere. Java code can be executed anywhere on any system.

2. Simple
Java is simple to learn and use. In Java, it is easy to write and debug
programs because Java does not use pointers. Java syntax is based on C++
(so easier for programmers to learn it after C++).
Java has removed many complicated and rarely-used features, for example,
explicit pointers, operator overloading, etc. If a programmer understands
the basic concepts of Oops, it becomes easier for him/her to learn Java
Programming.

3. Secure
Java is best known for its security. With Java, we can develop virus-free
systems. In today’s world everybody needs safety and security. Because of
to the threat of hackers, people feel unsafe while using application over the
Internet. To overcome such fears, Java provides safety and security
features. Java provides these securities by default. Some security can also

FULL STACK JAVA DEVELOPER 2


be provided by an application developer explicitly through SSL, JAAS,
Cryptography, etc.

4. Portable
Java is portable because it facilitates you to carry the Java byte code to any
platform. It doesn't require any implementation.

5. Robust
Robust simply means strong. Java is robust because:
a) It uses strong memory management.
b) There is a lack of pointers that avoids security problems.
There is automatic garbage collection in java which runs on the Java
Virtual Machine to get rid of objects which are not being used by a Java
application anymore.
There are exception handling and the type checking mechanism in Java.
All these points make Java robust.

6. Multithreading
Java's multithreaded feature it is possible to write programs that can
perform many tasks simultaneously. This design feature allows the
developers to construct interactive applications that can run smoothly.
Threads are important for multi-media, Web applications, etc.

7. Distributed
Java is distributed because it facilitates users to create distributed
applications in Java. RMI and EJB are used for creating distributed
applications. This feature of Java makes us able to access files by calling
the methods from any machine on the internet.

8. Architecture-neutral
Java compiler generates an architecture-neutral object file format, which
makes the compiled code executable on many processors, with the
presence of Java runtime system.

9. High Performance

FULL STACK JAVA DEVELOPER 3


Java is an interpreted language, so it will never be as fast as a compiled
language like C or C++. But, Java enables high performance with the use
of just-in-time compiler.

10.Dynamic
Java is a dynamic language. It supports dynamic loading of classes. It
means classes are loaded on demand. It also supports functions from its
native languages, i.e., C and C++.
Java supports dynamic compilation and automatic memory management
(garbage collection).

11.Object Oriented
In Java, everything is an Object and Classes. Java can be easily extended
since it is based on the Object model.

1.5. Java Virtual Machine


Java virtual Machine (JVM) is a virtual Machine that provides runtime
environment to execute java byte code. The JVM doesn't understand Java
code, that's why you compile your *.java files to obtain *.class files that
contain the bytecodes understandable by the JVM.
Java virtual Machine (JVM) is a virtual Machine that provides runtime
environment to execute java byte code. The JVM doesn't understand Java
code, that's why you compile your *.java files to obtain *.class files that
contain the bytecodes understandable by the JVM.
JVM is an engine that provides runtime environment to drive the Java Code
or applications. It converts Java bytecode into machines language. JVM is a
part of JRE (Java Run Environment).
JVM control execution of every Java program. It enables features such as
automated exception handling, Garbage-collected heap.

1.6. First Java Application


In this chapter, we will learn how to write the simple program of java. We
can write a simple Welcome java program easily. To create a simple java
program, you need to create a class that contains the main method.

FULL STACK JAVA DEVELOPER 4


public class Welcome {
public static void main(String[] args) {
System.out.println("Welcome to Full Stack Java Developer,Pune");
}
}

Output: Welcome to Full Stack Java Developer, Pune

Explanation-
 Class: This line uses the keyword class to declare that a new class is
being defined.
 public: It is an Access Modifier, which defines who can access this
Method. Public means that this Method will be accessible by any Class
 Welcome: It is an identifier that is the name of the class. The entire class
definition, including all of its members, will be between the opening
curly brace: {and the closing curly brace}.
 static: It is a keyword that identifies the class-related thing. It means the
given Method or variable is not instance-related but Class related. It can
be accessed without creating the instance of a Class.
 void: It is used to define the Return Type of the Method. It defines what
the method can return. Void means the Method will not return any value.
 main: It is the name of the Method. This Method name is searched by
JVM as a starting point for an application with a particular signature
only.
 String args[] / String… args: It is the parameter to the main method.
The argument name could be anything.
 System.out.println(): It is used to print statement. Here, System is a
class, out is the object of PrintStream class, println() is the method of
PrintStream class.

FULL STACK JAVA DEVELOPER 5

You might also like