Chapter 0111
Chapter 0111
Chapter 0111
Science
CHAPTER#-01
Java Programming Chapter 01
What is Java?
• Java is a programming language and a platform. Java is a high level, robust, object-oriented
and secure programming language.
• Java was developed by Sun Microsystems (which is now the subsidiary of Oracle) in the
year 1995.
• James Gosling is known as the father of Java. Before Java, its name was Oak. Since Oak was
already a registered company, so James Gosling and his team changed the Oak name to Java.
Application
1.Desktop Applications such as acrobat reader, media player,
antivirus, etc.
2.Web Applications such as irctc.co.in, javatpoint.com, etc.
3.Enterprise Applications such as banking applications.
4.Mobile
5.Smart Card
6.Robotics
7.Games, etc.
Java Programming Chapter 01
Continue…
3) Enterprise Application
An application that is distributed in nature, such as
banking applications, etc. is called enterprise
application. It has advantages of the high-level
security, load balancing, and clustering. In Java, EJB is
used for creating enterprise applications.
4) Mobile Application
An application which is created for mobile devices
is called a mobile application. Currently, Android is
used for creating mobile applications.
Java Programming Chapter 01
Java Editions
There are 3 platforms or editions of Java:
1) Java SE (Java Standard Edition)
It is a Java programming platform. It includes Java programming APIs such
as java.lang,java.io, java.net, java.util, java.sql, java.math etc. It includes
core topics like OOPs,Exception, Multithreading, I/O Stream, Networking,
AWT, Swing, etc.
History of Java
1) James Gosling, Mike Sheridan, and Patrick
Naughton initiated the Java language project in June 1991. The
small team of sun engineers called Green Team.
2) Initially it was designed for small, embedded systems in
electronic appliances like set-top boxes.
3) Firstly, it was called "Greentalk" by James Gosling, and the file
extension was .gt.
4) After that, it was called Oak and was developed as a part of the
Green project.
5) Why Oak? Oak is a symbol of strength and chosen as a national
tree of many countries like the U.S.A., France, Germany,
Romania, etc.
Java Programming Chapter 01
James Arthur Gosling, often referred to as "Dr. Java", (born May 19, 1955) is a Canadian computer scientist,
best known as the founder and lead designer behind the java programming Language.
Wikipedia
Java Programming Chapter 01
Features of Java
Java Programming Chapter 01
Java Programming Chapter 01
1. Simple
java is very easy to learn, and its syntax is simple, clean and easy to understand.
According to Sun Microsystem, Java language is a simple programming language because:
• 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.
2. Object Oriented
Java is an object-oriented programming language.
Basic concepts of OOPs are:
1. Object
2. Class
3. Inheritance
4. Polymorphism
5. Abstraction
6. Encapsulation
Java Programming Chapter 01
3. Platform Independent
Java is platform independent because it is different from other
languages like C, C++, etc. which are compiled into platform
specific machines.
Java code can be executed on multiple platforms, for example,
Windows, Linux, Sun Solaris, Mac/OS, etc. Java code is compiled by
the compiler and converted into bytecode. This bytecode is a
platform-independent code because it can be run on multiple
platforms, i.e., Write Once and Run Anywhere (WORA).
Java Programming Chapter 01
4. Secured
Java is best known for its security. With Java, we can develop
virus-free systems. Java is secured because:
• No explicit pointer
• Java Programs run inside a virtual machine
Java Programming Chapter 01
5. Robust
The English mining of Robust is strong. Java is robust
because:
1. It uses strong memory management.
2. There is a lack of pointers that avoids security
problems.
3. Java provides automatic garbage collection.
4. There are exception handling and the type checking
mechanism in Java. All these points make Java robust.
Java Programming Chapter 01
6. Architecture-neutral
Java is architecture neutral because there are no implementation
dependent features, for example, the size of primitive types is fixed.
In C programming, int data type occupies 2 bytes of memory for 32-
bit architecture and 4 bytes of memory for 64-bit architecture.
However, it occupies 4 bytes of memory for both 32 and 64-bit
architectures in Java.
7. Portable
Java is portable because it facilitates you to carry the Java bytecode
to any platform.
Java Programming Chapter 01
8. High-performance
Java is faster than other traditional interpreted
programming languages because Java bytecode is "close"
to native code. It is still a little bit slower than a compiled
language (e.g., C++).
9. Distributed
Java is distributed because it facilitates users to create distributed
applications in Java.
Java Programming Chapter 01
10. Multi-threaded
Multithreading allows the execution of multiple parts of a program
at the same time.
11. Dynamic
Java is considered as dynamic because of Bytecode. A source code
written in one platform, the same code can be executed in any
platform.
12. Interpreted
java is a interpreted language.
Java Programming Chapter 01
Example
class Simple{
public static void main(String args[]){
System.out.println("Hello Java");
}
}
Java Programming Chapter 01
Compilation Flow:
When we compile Java program using javac tool, the Java compiler
converts the source code into byte code.
Java Programming Chapter 01
Java Programming Chapter 01
What is JVM?
JVM (Java Virtual Machine) is an abstract machine. It is
called a virtual machine because it doesn't physically
exist. It is a specification that provides a runtime
environment in which Java bytecode can be executed.
The JVM performs the following main tasks:
• Loads code
• Verifies code
• Executes code
• Provides runtime environment
Java Programming Chapter 01
What is JRE?
JRE is an acronym for Java Runtime Environment. The Java Runtime
Environment is a set of software tools which are used for developing
Java applications.
It is used to provide the runtime environment. It is the implementation
of JVM. It physically exists. It contains a set of libraries + other files
that JVM uses at runtime.
Java Programming Chapter 01
Java Programming Chapter 01
What is JDK?
JDK is an acronym for Java Development Kit. The Java Development
Kit (JDK) is a software development environment which is used to
develop Java applications and applets.
It physically exists. It contains JRE + development tools.
Java Programming Chapter 01
Java Programming Chapter 01
Thought of Day
همیشه امید داشته باش چون همیشه فردایی هست