Student Corner
Name - Raj Kumar
Software Engineer At Hexagon Global
B.E CSE From Ait,Bangalore
Today Agenda
1 What is Java
2 History of Java
3 Features of Java
4 First Java Program
“Instruct the computer”: this basically means that you provide the computer a
set of instructions that are written in a language that the computer can
understand.
The instructions could be of various types.
For example:
• Adding 2 numbers
• Examples of procedural languages include Fortran, COBOL and C
What Object-Oriented Programming is?
• The basic entities in object-oriented programming are classes and objects.
Programming won’t make much sense if one can’t model real-world scenarios
using programming languages right? This is where Object-Oriented
Programming comes into play!.
• The basic idea of OOP is to divide a complex program into a bunch of
objects talking to each other.
• Objects in a program frequently represent real-world objects.
• Examples: Java, Python, JavaScript.
Anatomy of Objects and Classes
Objects may contain data in the form of fields (variables) and methods to
operate on that data. For a while, think about the real-world objects around
you."What are the characteristics of these objects? Take the example of a light
bulb. It has a state i.e. either it is on or off. It also has a behavior i.e. when you
turn it on it lights up and when turned off, it stops spreading light.
To conclude this one can say:
Interesting! isn’t it? But the question is “where do these objects
come from?”
Well, the answer to the above question is classes.
What Is Java?
What is Java
Java is a programming language and a platform
Independent .
Java is a high level, robust, object-oriented and
secure programming language.
James Gosling by 1995
History of Java
• Java was originally developed by James Gosling at Sun
Microsystems (which has since been acquired by Oracle)
and released in 1995 as a core component of Sun
Microsystems' Java platform.
• Before Java, its name was Oak. Since Oak was already a registed
company, so James Gosling and his team changed the Oak
name to Java.
• The latest version is Java 12, released in March 2019.
Feature In Java
It is Simple & Portable: Memory Management
using Pointers is not allowed.
Java is portable because it facilitates you to carry
the Java bytecode to any platform. It doesn't require
any implementation.
Java as Platform Independent
• Platform independent language
means once compiled you can execute
the program on any platform (OS).
• The Java compiler converts the source
code to bytecode, which is an
intermediate Language.
• The bytecode generated is a
non_x0002_executable
code and needs an
interpreter to execute on a machine.
This interpreter is the JVM and thus
the Bytecode is executed by the JVM.
• Java is platform independent but JVM
is platform dependent
High Performance: With the use of JIT (Just-In-Time) compilers, Java
achieves high performance
through the use of byte-code that can be easily
translated into native machine code.
Just In Time Compiler
The JIT compiler aids in
improving the performance
of Java programs by
compiling bytecode into
native machine code at
run time.
Working of JIT Compiler
The Just-In-Time (JIT) compiler is a an essential part of the JRE i.e. Java
Runtime Environment, that is responsible for performance optimization of
java based applications at run time. Compiler is one of the key aspects in
deciding performance of an application for both parties i.e. the end user and
the application developer.
• It is Robust: Java has its own strong memory
management system. This helps to eliminate errors
as it checks the code during compile and runtime.
• It uses strong memory management.
• 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.
Object-oriented
Java is an object-oriented programming language. Everything in Java is an
object. Object-oriented means we organize our software as a combination of
different types of objects that incorporates both data and behavior.
Object-oriented programming (OOPs) is a methodology that simplifies
software development and maintenance by providing some rules.
Basic concepts of OOPs are:
Object
Class
Inheritance
Polymorphism
Abstraction
Encapsulation
Thank you
Student Corner