SlideShare a Scribd company logo
JAVA
SUJIT MAJETY | 1 : INTRODUCTION TO JAVA
Course Description


Introduction to JAVA



Location : SREC



History



Lectures: Weekdays at 11:00 am



Features



Labs: Weekdays at 01:30 pm



JVM



Presenter:



Architecture of JVM



Introduction to OOPS



Object



Class

Sujit Majety,
Software Engineer,
Tech Fort IT Solutions (INDIA) PVT Ltd.
Introduction to JAVA


Let’s start the exiting journey.



Java is one of the most powerful programming languages.



Java is Cross-platform, object-oriented, network-based, reliable programming
language.



The slogan of java is “write once and run anywhere”, this allowed java to gain
enormous popularity. Its rapid ascensation and wide acceptance can be traced to its
design and programming features.



The name “JAVA” came from the name of the coffee seed.



JAVA released to market in three versions J2SE, J2EE, J2ME
Programming Paradigm
Procedure Oriented


More emphasis on algorithms.



Programs divided into functions.



Most functions share data, less security to
data.



Data move around the system between
functions, any function can change the data.



Adding new code is very difficult.



Code cannot be re-used.



E.g. C, VB, Perl, Basic, Fortran

Object Oriented


More emphasis on data.



Programs are divided into objects.



Functions operate on data are tied together
in the data structure.



Data is secured; it is hidden to external
functions, can be accessed by functions
tied to it.



Adding new code is very easy.



Code can be re-used.



E.g. CPP, Java, VB.Net, C#.Net
History


Developed by a team led by James Gosling at Sun Microsystems.



Sun Microsystems was a company best known for its workstations.



Java was originally OAK, designed for use in embedded consumer electronic
application in 1991.



OAK was redesigned for developing internet applications and renamed JAVA in
1995.



Java is inherently object-oriented.
Features
There are eleven promising features in java


Simple (no pointers, interfaces, rich set of API, friendly syntaxes)



Secure (many number of security mechanisms to block stray programs)



Portable (can run on any operating system)



Robust (memory management, exceptional handling)



Distributed (runs on multiple servers and can be accessed by no of clients)



Interpreted (both compiled and interpreted)



Multi Threading (multiple flow of controls)



Dynamic (is always open for updating)



Architecture Neutral (can run on any processor)



High Performance (garbage collector, leaves resources wile waiting for inputs)



Object oriented (everything is written in class)
Java Virtual Machine


JVM is an abstract machine.



It is a specification that provides runtime environment in which java byte code can be
executed.



JVM’s are available for many hardware and software platforms (i.e. JVM is platform
dependant).



JVM performs four main tasks,


Loads code



Verifies code



Executes code



Provides runtime environment.
Architecture of JVM
Class Loader
Subsystem

Class Files

Runtime
data
areas

Method
Area

Execution Engine

Heap

Stack

PC
Registers

Native
Method
Area
Introduction to OOPS


Object oriented programming models the real world.



Object oriented programming organizes a program around its data and set of well
defined interfaces to that data.



An object-oriented program can be characterized as data controlling access to
code.



By switching the controlling entity to data, you can achieve several organizational
benefits.



Object oriented programming, the first letter indicates object.



What is an object?
Object


An object is the basic unit of object orientation with behaviour and identity.



An object is a real time entity. E.g.. Car, bike, book, me and you.



It is a runtime entity that has a state and behaviour.



The state of the object represents the data.



The behaviour is represented by the methods.



E.g. An object is created to represent a rabbit.
It would have data: how hungry it is, where it is.
And methods : eat, hide, run and dig.
Class


A class is a way of binding the data and associated methods into a single unit.



A class can also be said as a blue print to create an object.



If we want to develop a java program, then that should be developed with respective of
class only. i.e. without class there is no java program.



Syntax:

Class <clsname>
{
Variable declaration;

Class Name

Animal

Data members/
properties/
Attributes

Name,
Number of legs,
Colour

Behaviours/
Methods

Eat(),
Walk(),
Sleep()

Methods definition;
};
Sample Program
class Test
{
public static void main(String[] args)
{
System.out.println(“Hello World”);
}
}
Execution:
> javac Test.java
> java Test
Execution of java program


The java program execution can be seen through the following
figure.

Test.java

Test.class

JVM

Java Program
Source code

Byte code

JVM converts byte
code to m/c code

Console

Program Output
Important Interview Questions


What is the most widely used protocol on internet



What is the difference between an executable file and .class file?



Why java is suitable for internet?



Why pointers are eliminated in java?



What is the difference between a function and a method?



Which part of the JVM will allocate the memory for java program?



Which algorithm is used by garbage collector to remove the unused variables or objects
from memory?
Assignments


Check the hello world program by removing each and every word.



Shuffle the order of public static void main



Try experimenting with print & println.



Try giving different names for args.



Try giving int args[] instead of String args[] in main.



Give Different name for the filename and the class name



Repeat the above problem with declaring class as public



Copy the class file into different folder name and execute it.



Write your own program, compile it and execute it.



Try giving different data types ( the one you know like int x, double d ) in the prinltn and see if it prints all of
them.



I have two Integers int x =1; and int x=2; I wish to print 12. find the ways to print.



Repeat the same if I want to print given int x=1; double d=2.5; and print 12 instead of 12.5
Questions?
Sujit Majety
+91 9000019878
mail to : sujit.naga@gmail.com
Ad

More Related Content

What's hot (20)

core java
core javacore java
core java
Roushan Sinha
 
Java seminar
Java seminarJava seminar
Java seminar
devendrakhairwa
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
Sandeep Rawat
 
Grade 8: Introduction To Java
Grade 8: Introduction To JavaGrade 8: Introduction To Java
Grade 8: Introduction To Java
nandanrocker
 
Java notes
Java notesJava notes
Java notes
Chaitanya Rajkumar Limmala
 
Core Java
Core JavaCore Java
Core Java
Prakash Dimmita
 
Java and its features
Java and its featuresJava and its features
Java and its features
Pydi Nikhil
 
Java Programming for Designers
Java Programming for DesignersJava Programming for Designers
Java Programming for Designers
R. Sosa
 
Core java slides
Core java slidesCore java slides
Core java slides
Abhilash Nair
 
Java Programming
Java ProgrammingJava Programming
Java Programming
Elizabeth alexander
 
Java programming(unit 1)
Java programming(unit 1)Java programming(unit 1)
Java programming(unit 1)
Dr. SURBHI SAROHA
 
Introduction to Java Programming Language
Introduction to Java Programming LanguageIntroduction to Java Programming Language
Introduction to Java Programming Language
jaimefrozr
 
CS8392 OOP
CS8392 OOPCS8392 OOP
CS8392 OOP
DhanalakshmiVelusamy1
 
basic core java up to operator
basic core java up to operatorbasic core java up to operator
basic core java up to operator
kamal kotecha
 
Java Presentation
Java PresentationJava Presentation
Java Presentation
pm2214
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
Professional Guru
 
Java for C++ programers
Java for C++ programersJava for C++ programers
Java for C++ programers
Salahaddin University-Erbil
 
Java programming course for beginners
Java programming course for beginnersJava programming course for beginners
Java programming course for beginners
Eduonix Learning Solutions
 
INTRODUCTION TO JAVA APPLICATION
INTRODUCTION TO JAVA APPLICATIONINTRODUCTION TO JAVA APPLICATION
INTRODUCTION TO JAVA APPLICATION
Ajit Yadav
 
Genesis and Overview of Java
Genesis and Overview of Java Genesis and Overview of Java
Genesis and Overview of Java
Ravi_Kant_Sahu
 

Viewers also liked (7)

Brinkman Assignment 5 PTA Presentation
Brinkman Assignment 5 PTA PresentationBrinkman Assignment 5 PTA Presentation
Brinkman Assignment 5 PTA Presentation
meagbrinkman
 
Present simple
Present simplePresent simple
Present simple
Sonia Fernández
 
Java intro
Java introJava intro
Java intro
Sonam Sharma
 
Green land convent school
Green land convent schoolGreen land convent school
Green land convent school
Sonam Sharma
 
Multithreaded programming
Multithreaded programmingMultithreaded programming
Multithreaded programming
Sonam Sharma
 
Assembler
AssemblerAssembler
Assembler
Sonam Sharma
 
Linux webmin
Linux webminLinux webmin
Linux webmin
Sonam Sharma
 
Ad

Similar to Introduction to java (20)

Java PPT
Java PPTJava PPT
Java PPT
Dilip Kr. Jangir
 
Java1
Java1Java1
Java1
computertuitions
 
Java
Java Java
Java
computertuitions
 
Java essentials for hadoop
Java essentials for hadoopJava essentials for hadoop
Java essentials for hadoop
KCC Software Ltd. & Easylearning.guru
 
Java essentials for hadoop
Java essentials for hadoopJava essentials for hadoop
Java essentials for hadoop
Seo Gyansha
 
Unit1 introduction to Java
Unit1 introduction to JavaUnit1 introduction to Java
Unit1 introduction to Java
DevaKumari Vijay
 
Java Technologies notes of unit 1 and 2.
Java Technologies notes of unit 1 and 2.Java Technologies notes of unit 1 and 2.
Java Technologies notes of unit 1 and 2.
sumanyadavdpg
 
Java_Interview Qns
Java_Interview QnsJava_Interview Qns
Java_Interview Qns
ManikandanRamanujam
 
Java For beginners to build a strong foundation
Java For beginners to build a strong foundationJava For beginners to build a strong foundation
Java For beginners to build a strong foundation
Satheesh Chandran
 
Modern_2.pptx for java
Modern_2.pptx for java Modern_2.pptx for java
Modern_2.pptx for java
MayaTofik
 
Cs8392 oops 5 units notes
Cs8392 oops 5 units notes Cs8392 oops 5 units notes
Cs8392 oops 5 units notes
Narayanan sockalinganathan
 
Java interview questions and answers for cognizant By Data Council Pune
Java interview questions and answers for cognizant By Data Council PuneJava interview questions and answers for cognizant By Data Council Pune
Java interview questions and answers for cognizant By Data Council Pune
Pankaj kshirsagar
 
Object Oriented Programming All Unit Notes
Object Oriented Programming All Unit NotesObject Oriented Programming All Unit Notes
Object Oriented Programming All Unit Notes
BalamuruganV28
 
Java
JavaJava
Java
seenak
 
A seminar report on core java
A  seminar report on core javaA  seminar report on core java
A seminar report on core java
Aisha Siddiqui
 
Java Simplified: Understanding Programming Basics
Java Simplified: Understanding Programming BasicsJava Simplified: Understanding Programming Basics
Java Simplified: Understanding Programming Basics
Akshaj Vadakkath Joshy
 
Mastering Java Terminologies_ Essential Concepts for Beginners.pdf
Mastering Java Terminologies_ Essential Concepts for Beginners.pdfMastering Java Terminologies_ Essential Concepts for Beginners.pdf
Mastering Java Terminologies_ Essential Concepts for Beginners.pdf
CodeYoung
 
What is java?-Saurabh Upadhyay
What is java?-Saurabh UpadhyayWhat is java?-Saurabh Upadhyay
What is java?-Saurabh Upadhyay
Saurabh Upadhyay
 
Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2
Kuntal Bhowmick
 
Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2
Kuntal Bhowmick
 
Java essentials for hadoop
Java essentials for hadoopJava essentials for hadoop
Java essentials for hadoop
Seo Gyansha
 
Unit1 introduction to Java
Unit1 introduction to JavaUnit1 introduction to Java
Unit1 introduction to Java
DevaKumari Vijay
 
Java Technologies notes of unit 1 and 2.
Java Technologies notes of unit 1 and 2.Java Technologies notes of unit 1 and 2.
Java Technologies notes of unit 1 and 2.
sumanyadavdpg
 
Java For beginners to build a strong foundation
Java For beginners to build a strong foundationJava For beginners to build a strong foundation
Java For beginners to build a strong foundation
Satheesh Chandran
 
Modern_2.pptx for java
Modern_2.pptx for java Modern_2.pptx for java
Modern_2.pptx for java
MayaTofik
 
Java interview questions and answers for cognizant By Data Council Pune
Java interview questions and answers for cognizant By Data Council PuneJava interview questions and answers for cognizant By Data Council Pune
Java interview questions and answers for cognizant By Data Council Pune
Pankaj kshirsagar
 
Object Oriented Programming All Unit Notes
Object Oriented Programming All Unit NotesObject Oriented Programming All Unit Notes
Object Oriented Programming All Unit Notes
BalamuruganV28
 
A seminar report on core java
A  seminar report on core javaA  seminar report on core java
A seminar report on core java
Aisha Siddiqui
 
Java Simplified: Understanding Programming Basics
Java Simplified: Understanding Programming BasicsJava Simplified: Understanding Programming Basics
Java Simplified: Understanding Programming Basics
Akshaj Vadakkath Joshy
 
Mastering Java Terminologies_ Essential Concepts for Beginners.pdf
Mastering Java Terminologies_ Essential Concepts for Beginners.pdfMastering Java Terminologies_ Essential Concepts for Beginners.pdf
Mastering Java Terminologies_ Essential Concepts for Beginners.pdf
CodeYoung
 
What is java?-Saurabh Upadhyay
What is java?-Saurabh UpadhyayWhat is java?-Saurabh Upadhyay
What is java?-Saurabh Upadhyay
Saurabh Upadhyay
 
Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2
Kuntal Bhowmick
 
Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2Class notes(week 2) on basic concepts of oop-2
Class notes(week 2) on basic concepts of oop-2
Kuntal Bhowmick
 
Ad

Recently uploaded (20)

#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.Greenhouse_Monitoring_Presentation.pptx.
Greenhouse_Monitoring_Presentation.pptx.
hpbmnnxrvb
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 

Introduction to java

  • 1. JAVA SUJIT MAJETY | 1 : INTRODUCTION TO JAVA
  • 2. Course Description  Introduction to JAVA  Location : SREC  History  Lectures: Weekdays at 11:00 am  Features  Labs: Weekdays at 01:30 pm  JVM  Presenter:  Architecture of JVM  Introduction to OOPS  Object  Class Sujit Majety, Software Engineer, Tech Fort IT Solutions (INDIA) PVT Ltd.
  • 3. Introduction to JAVA  Let’s start the exiting journey.  Java is one of the most powerful programming languages.  Java is Cross-platform, object-oriented, network-based, reliable programming language.  The slogan of java is “write once and run anywhere”, this allowed java to gain enormous popularity. Its rapid ascensation and wide acceptance can be traced to its design and programming features.  The name “JAVA” came from the name of the coffee seed.  JAVA released to market in three versions J2SE, J2EE, J2ME
  • 4. Programming Paradigm Procedure Oriented  More emphasis on algorithms.  Programs divided into functions.  Most functions share data, less security to data.  Data move around the system between functions, any function can change the data.  Adding new code is very difficult.  Code cannot be re-used.  E.g. C, VB, Perl, Basic, Fortran Object Oriented  More emphasis on data.  Programs are divided into objects.  Functions operate on data are tied together in the data structure.  Data is secured; it is hidden to external functions, can be accessed by functions tied to it.  Adding new code is very easy.  Code can be re-used.  E.g. CPP, Java, VB.Net, C#.Net
  • 5. History  Developed by a team led by James Gosling at Sun Microsystems.  Sun Microsystems was a company best known for its workstations.  Java was originally OAK, designed for use in embedded consumer electronic application in 1991.  OAK was redesigned for developing internet applications and renamed JAVA in 1995.  Java is inherently object-oriented.
  • 6. Features There are eleven promising features in java  Simple (no pointers, interfaces, rich set of API, friendly syntaxes)  Secure (many number of security mechanisms to block stray programs)  Portable (can run on any operating system)  Robust (memory management, exceptional handling)  Distributed (runs on multiple servers and can be accessed by no of clients)  Interpreted (both compiled and interpreted)  Multi Threading (multiple flow of controls)  Dynamic (is always open for updating)  Architecture Neutral (can run on any processor)  High Performance (garbage collector, leaves resources wile waiting for inputs)  Object oriented (everything is written in class)
  • 7. Java Virtual Machine  JVM is an abstract machine.  It is a specification that provides runtime environment in which java byte code can be executed.  JVM’s are available for many hardware and software platforms (i.e. JVM is platform dependant).  JVM performs four main tasks,  Loads code  Verifies code  Executes code  Provides runtime environment.
  • 8. Architecture of JVM Class Loader Subsystem Class Files Runtime data areas Method Area Execution Engine Heap Stack PC Registers Native Method Area
  • 9. Introduction to OOPS  Object oriented programming models the real world.  Object oriented programming organizes a program around its data and set of well defined interfaces to that data.  An object-oriented program can be characterized as data controlling access to code.  By switching the controlling entity to data, you can achieve several organizational benefits.  Object oriented programming, the first letter indicates object.  What is an object?
  • 10. Object  An object is the basic unit of object orientation with behaviour and identity.  An object is a real time entity. E.g.. Car, bike, book, me and you.  It is a runtime entity that has a state and behaviour.  The state of the object represents the data.  The behaviour is represented by the methods.  E.g. An object is created to represent a rabbit. It would have data: how hungry it is, where it is. And methods : eat, hide, run and dig.
  • 11. Class  A class is a way of binding the data and associated methods into a single unit.  A class can also be said as a blue print to create an object.  If we want to develop a java program, then that should be developed with respective of class only. i.e. without class there is no java program.  Syntax: Class <clsname> { Variable declaration; Class Name Animal Data members/ properties/ Attributes Name, Number of legs, Colour Behaviours/ Methods Eat(), Walk(), Sleep() Methods definition; };
  • 12. Sample Program class Test { public static void main(String[] args) { System.out.println(“Hello World”); } } Execution: > javac Test.java > java Test
  • 13. Execution of java program  The java program execution can be seen through the following figure. Test.java Test.class JVM Java Program Source code Byte code JVM converts byte code to m/c code Console Program Output
  • 14. Important Interview Questions  What is the most widely used protocol on internet  What is the difference between an executable file and .class file?  Why java is suitable for internet?  Why pointers are eliminated in java?  What is the difference between a function and a method?  Which part of the JVM will allocate the memory for java program?  Which algorithm is used by garbage collector to remove the unused variables or objects from memory?
  • 15. Assignments  Check the hello world program by removing each and every word.  Shuffle the order of public static void main  Try experimenting with print & println.  Try giving different names for args.  Try giving int args[] instead of String args[] in main.  Give Different name for the filename and the class name  Repeat the above problem with declaring class as public  Copy the class file into different folder name and execute it.  Write your own program, compile it and execute it.  Try giving different data types ( the one you know like int x, double d ) in the prinltn and see if it prints all of them.  I have two Integers int x =1; and int x=2; I wish to print 12. find the ways to print.  Repeat the same if I want to print given int x=1; double d=2.5; and print 12 instead of 12.5