SlideShare a Scribd company logo
Instructor: @Subash @Paudyal
Pokhara & Tribhuvan University
Kathmandu, Nepal
Training on Java
Programming
• Java Introduction
• Java History
• Why Learn Java
• Java Version
• Java IDE
• Java Features
• Java Program Structure
• What happens at Compile and Runtime ?
• Distinction between JVM, JRE and JDK
Session 1: Fundamentals
© paudyalsubash@yahoo.com 2
• Java is a programming language and a platform.
• Java is a high level, robust, secured and object-oriented
programming language.
Introduction (What java)
© paudyalsubash@yahoo.com 3
• James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language
project in June 1991.
• Firstly, it was called "Greentalk" by James Gosling and file extension was .gt.
• After that, it was called Oak and was developed as a part of the Green project.
• Why Oak? Oak is a symbol of strength and chosen as a national tree of many
countries like U.S.A., France, Germany, Romania etc. (presumably because he liked
the look of an oak tree that was right outside his window at Sun).
• In 1995, Oak was renamed as "Java" because it was already a trademark by Oak
Technologies.
• Why java? The team gathered to choose a new name. According to James Gosling
"Java was one of the top choices along with Silk". Since java was so unique, most
of the team members preferred java.
• Java is an island of Indonesia where first coffee was produced (called java coffee).
• Originally developed by James Gosling at Sun Microsystems (which is now a
subsidiary of Oracle Corporation) and released in 1995.
History (How Java)
© paudyalsubash@yahoo.com 4
Why Java?
• Large codebase of already written applications
• 9 million of professional Java developers
• Lots of enterprise applications were developed and are being
developed in Java
• The same program can run on different platforms
• Mobile Android development is done in Java
• According to Sun, 3 billion devices run java. There are many
devices where java is currently used.
© paudyalsubash@yahoo.com 5
• Some of the devices using java are as follows:
• Desktop Applications such as acrobat reader, media player, antivirus etc.
• Web Applications such as irctc.co.in, javatpoint.com etc.
• Enterprise Applications such as banking applications.
• Mobile
• Embedded System
• Smart Card
• Robotics
• Games etc.
Devices using Java
© paudyalsubash@yahoo.com 6
• There are mainly 4 type of applications that can be created using java
programming:
• Standalone Application: (J2SE) – Standard Edition
It is also known as desktop application or window-based application. An application that we
need to install on every machine such as media player, antivirus etc. AWT and Swing are used
in java for creating standalone applications.
• Web Application:
An application that runs on the server side and creates dynamic page, is called web
application. Currently, servlet, jsp, struts, jsf etc. technologies are used for creating web
applications in java.
• Enterprise Application: (J2EE) – Enterprise Edition
An application that is distributed in nature, such as banking applications etc. It has the
advantage of high level security, load balancing and clustering. In java, EJB is used for creating
enterprise applications.
• Mobile Application: (J2ME) – Micro Edition
An application that is created for mobile devices. Currently Android and Java ME are used for
creating mobile applications.
Types of Java Applications
© paudyalsubash@yahoo.com 7
• Simple
• Object oriented
• Platform independent
• Secured
• Multi-threaded
• Robust
• Portable
• High Performance
Features of Java
© paudyalsubash@yahoo.com 8
• syntax is based on C++ (so easier for programmers to learn it
after C++).
• removed many confusing and/or rarely-used features e.g.,
explicit pointers, operator overloading etc.
• No need to remove unreferenced objects because there is
Automatic Garbage Collection in java.
Simple
© paudyalsubash@yahoo.com 9
• Object-oriented means we organize our software as a combination of
different types of objects that incorporates both data and behaviour.
• Object-oriented programming(OOPs) is a methodology that simplify
software development and maintenance by providing some rules.
• Basic concepts of OOPs are:
• Object
• Class
• Inheritance
• Polymorphism
• Abstraction
• Encapsulation
Object Oriented
© paudyalsubash@yahoo.com 10
• A platform is the hardware or software environment in which a program
runs.
• There are two types of platforms software-based and hardware-based.
• Java provides software-based platform. The Java platform differs from most
other platforms in the sense that it's a software-based platform that runs
on top of other hardware-based platforms.
• It has two components:
• Runtime Environment
• API(Application Programming Interface)
• java is platform independent Java code can be run on multiple platforms
e.g.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).
Platform Independent
© paudyalsubash@yahoo.com 11
© paudyalsubash@yahoo.com 12
• Java is secured because:
• No explicit pointer
• Programs run inside virtual machine sandbox.
• Security provided by Java Language
• Classloader
• adds security by separating the package for the classes of
the local file system from those that are imported from
network sources.
• Bytecode Verifier
• checks the code fragments for illegal code that can violate
access right to objects.
• Security Manager
• determines what resources a class can access such as
reading and writing to the local disk.
Secure
© paudyalsubash@yahoo.com 13
• A thread is like a separate program, executing concurrently. We can
write Java programs that deal with many tasks at once by defining
multiple threads. The main advantage of multi-threading is that it
shares the same memory. Threads are important for multi-media,
Web applications etc.
• Robust simply means strong. Java uses strong memory management.
There are lack of pointers that avoids security problem. There is
automatic garbage collection in java. There is exception handling and
type checking mechanism in java. All these points makes java robust.
• We may carry the java bytecode to any platform.
• Java is faster than traditional interpretation since byte code is "close"
to native code still somewhat slower than a compiled language (e.g.,
C++)
Multi-Tasking, Robust, Portable, high
performance
© paudyalsubash@yahoo.com 14
Run First Program
• Three steps to run the Java
program
 Write the program and save it in a file
with the name that ends with .java,
for example
HelloWorld.java
 Compile the program using javac
compiler which creates
HelloWorld.class file, for example
javac HelloWorld.java
 Run your program:
java HelloWorld
class HelloWorld {
public static void main(String[] args)
{
System.out.println (“Hello,
world!");
}
}
© paudyalsubash@yahoo.com 15
• class keyword is used to declare a class in java.
• public keyword is an access modifier which represents visibility, it means it is visible to all.
• (if its not public JVM classes might not able to access it)
• static is a keyword, if we declare any method as static, it is known as static method. The
core advantage of static method is that there is no need to create object to invoke the
static method. The main method is executed by the JVM, so it doesn't require to create
object to invoke the main method. So it saves memory.
• (While JVM tries to execute Java program it doesn't know how to create instance of main
class as there is no standard constructor is defined for main class)
• void is the return type of the method, it means it doesn't return any value.
• (because it doesn't return any thing to caller which is JVM)
• main represents startup of the program.
• String[] args is used for command line argument. We will learn it later.
• System.out.println() is used print statement. We will learn about the internal working of
System.out.println statement later.
Understanding Keywords
© paudyalsubash@yahoo.com 16
• At compile time, java file is compiled by Java Compiler and
converts the java code into bytecode.
• It does not interact with OS
What happens at compile time?
© paudyalsubash@yahoo.com 17
What happens at runtime?
© paudyalsubash@yahoo.com 18
• JVM (Java Virtual Machine) is an abstract machine. It is a specification
that provides runtime environment in which java bytecode can be
executed.
• JVMs are available for many hardware and software platforms. JVM,
JRE and JDK are platform dependent because configuration of each
OS differs. But, Java is platform independent.
• The JVM performs following main tasks:
• Loads code
• Verifies code
• Executes code
• Provides runtime environment
Difference between JVM, JRE and JDK
© paudyalsubash@yahoo.com 19
• JRE is an acronym for Java Runtime
Environment.It is used to provide
runtime environment.It is the
implementation of JVM.
• It physically exists. It contains set of
libraries + other files that JVM uses
at runtime.
• Implementation of JVMs are also
actively released by other
companies besides Sun Micro
Systems.
JRE
© paudyalsubash@yahoo.com 20
• JDK is an acronym
for Java
Development Kit.
• It physically exists.It
contains JRE +
development tools.
JDK
© paudyalsubash@yahoo.com 21
Java IDE
• Integrated Development Environment (IDE)
• Makes your work more productive
• Includes text editor, compiler, debugger, context sensitive, help,
works with different Java SDKs
• Most widely used IDEs:
• Netbeans (Oracle)
• Eclipse (Open)
• Intellijidea (Jetbrains)
© paudyalsubash@yahoo.com 22
• Queries?
End of Java Introduction
© paudyalsubash@yahoo.com 23
Ad

More Related Content

What's hot (20)

1 .java basic
1 .java basic1 .java basic
1 .java basic
Indu Sharma Bhardwaj
 
Java (Part 2) unit 1
Java (Part 2) unit 1Java (Part 2) unit 1
Java (Part 2) unit 1
Dr. SURBHI SAROHA
 
Introduction to JAVA
Introduction to JAVAIntroduction to JAVA
Introduction to JAVA
Md. Tanvir Hossain
 
JAVA ENVIRONMENT
JAVA  ENVIRONMENTJAVA  ENVIRONMENT
JAVA ENVIRONMENT
josemachoco
 
Introduction To Core Java - SpringPeople
Introduction To Core Java - SpringPeopleIntroduction To Core Java - SpringPeople
Introduction To Core Java - SpringPeople
SpringPeople
 
Java features
Java featuresJava features
Java features
myrajendra
 
Features of java 02
Features of java 02Features of java 02
Features of java 02
University of Potsdam
 
Basics of JAVA programming
Basics of JAVA programmingBasics of JAVA programming
Basics of JAVA programming
Elizabeth Thomas
 
JRE , JDK and platform independent nature of JAVA
JRE , JDK and platform independent nature of JAVAJRE , JDK and platform independent nature of JAVA
JRE , JDK and platform independent nature of JAVA
Mehak Tawakley
 
Java
JavaJava
Java
kavirishi
 
Lec 3 01_aug13
Lec 3 01_aug13Lec 3 01_aug13
Lec 3 01_aug13
Palak Sanghani
 
JAVA FEATURES
JAVA FEATURESJAVA FEATURES
JAVA FEATURES
shalinikarunakaran1
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)
Sujit Majety
 
Java unit 1
Java unit 1Java unit 1
Java unit 1
Shipra Swati
 
Whats new in Java 9,10,11,12
Whats new in Java 9,10,11,12Whats new in Java 9,10,11,12
Whats new in Java 9,10,11,12
Rory Preddy
 
Java programming(unit 1)
Java programming(unit 1)Java programming(unit 1)
Java programming(unit 1)
Dr. SURBHI SAROHA
 
Java basic-tutorial for beginners
Java basic-tutorial for beginners Java basic-tutorial for beginners
Java basic-tutorial for beginners
Muzammil Ali
 
Java presentation
Java presentationJava presentation
Java presentation
surajdmk
 
Presentation5
Presentation5Presentation5
Presentation5
Natasha Bains
 
Advantages of java
Advantages of javaAdvantages of java
Advantages of java
xxx007008
 

Similar to Java fundamentals (20)

Object Oriented Programming Part 1 of Unit 1
Object Oriented Programming Part 1 of Unit 1Object Oriented Programming Part 1 of Unit 1
Object Oriented Programming Part 1 of Unit 1
VigneshkumarPonnusam1
 
PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptPPS Java Overview Unit I.ppt
PPS Java Overview Unit I.ppt
CDSukte
 
PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptPPS Java Overview Unit I.ppt
PPS Java Overview Unit I.ppt
RajeshSukte1
 
unit1.pptx
unit1.pptxunit1.pptx
unit1.pptx
PrasadKalal4
 
JAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptxJAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptx
SuganthiDPSGRKCW
 
java basics concepts and the keywords needed
java basics concepts and the keywords neededjava basics concepts and the keywords needed
java basics concepts and the keywords needed
PriyadharshiniG41
 
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptxJAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
JAVA PROGRAM CONSTRUCTS OR LANGUAGE BASICS.pptx
AALIM MUHAMMED SALEGH COLLEGE OF ENGINEERING
 
JAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxJAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptx
Murugesh33
 
JAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxJAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptx
Murugesh33
 
1 java intro
1 java intro1 java intro
1 java intro
abdullah al mahamud rosi
 
Java Basics
Java BasicsJava Basics
Java Basics
Fahad Shahzad
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
Java Lover
 
1.Intro--Why Java.pptx
1.Intro--Why Java.pptx1.Intro--Why Java.pptx
1.Intro--Why Java.pptx
YounasKhan542109
 
Introduction to Core Java feature and its characteristics
Introduction to Core Java feature and its characteristicsIntroduction to Core Java feature and its characteristics
Introduction to Core Java feature and its characteristics
rashmishekhar81
 
Getting Started with JAVA
Getting Started with JAVAGetting Started with JAVA
Getting Started with JAVA
ShivamPathak318367
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
sunmitraeducation
 
JAVA INTRODUCTION - 1
JAVA INTRODUCTION - 1JAVA INTRODUCTION - 1
JAVA INTRODUCTION - 1
Infoviaan Technologies
 
Java ppt-class_Introduction_class_Objects.ppt
Java ppt-class_Introduction_class_Objects.pptJava ppt-class_Introduction_class_Objects.ppt
Java ppt-class_Introduction_class_Objects.ppt
VGaneshKarthikeyan
 
Java introduction
Java introductionJava introduction
Java introduction
logeswarisaravanan
 
JAVA PROGRAMING NOTE FOR BEGINNERS 20242
JAVA PROGRAMING NOTE FOR BEGINNERS 20242JAVA PROGRAMING NOTE FOR BEGINNERS 20242
JAVA PROGRAMING NOTE FOR BEGINNERS 20242
boatengsolo963
 
Object Oriented Programming Part 1 of Unit 1
Object Oriented Programming Part 1 of Unit 1Object Oriented Programming Part 1 of Unit 1
Object Oriented Programming Part 1 of Unit 1
VigneshkumarPonnusam1
 
PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptPPS Java Overview Unit I.ppt
PPS Java Overview Unit I.ppt
CDSukte
 
PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptPPS Java Overview Unit I.ppt
PPS Java Overview Unit I.ppt
RajeshSukte1
 
JAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptxJAVA PROGRAMMING-Unit I - Final PPT.pptx
JAVA PROGRAMMING-Unit I - Final PPT.pptx
SuganthiDPSGRKCW
 
java basics concepts and the keywords needed
java basics concepts and the keywords neededjava basics concepts and the keywords needed
java basics concepts and the keywords needed
PriyadharshiniG41
 
JAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxJAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptx
Murugesh33
 
JAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxJAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptx
Murugesh33
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
Java Lover
 
Introduction to Core Java feature and its characteristics
Introduction to Core Java feature and its characteristicsIntroduction to Core Java feature and its characteristics
Introduction to Core Java feature and its characteristics
rashmishekhar81
 
Java ppt-class_Introduction_class_Objects.ppt
Java ppt-class_Introduction_class_Objects.pptJava ppt-class_Introduction_class_Objects.ppt
Java ppt-class_Introduction_class_Objects.ppt
VGaneshKarthikeyan
 
JAVA PROGRAMING NOTE FOR BEGINNERS 20242
JAVA PROGRAMING NOTE FOR BEGINNERS 20242JAVA PROGRAMING NOTE FOR BEGINNERS 20242
JAVA PROGRAMING NOTE FOR BEGINNERS 20242
boatengsolo963
 
Ad

Recently uploaded (20)

Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Automation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath CertificateAutomation Techniques in RPA - UiPath Certificate
Automation Techniques in RPA - UiPath Certificate
VICTOR MAESTRE RAMIREZ
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage DashboardsAdobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
Adobe Marketo Engage Champion Deep Dive - SFDC CRM Synch V2 & Usage Dashboards
BradBedford3
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
What Do Contribution Guidelines Say About Software Testing? (MSR 2025)
Andre Hora
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Ad

Java fundamentals

  • 1. Instructor: @Subash @Paudyal Pokhara & Tribhuvan University Kathmandu, Nepal Training on Java Programming
  • 2. • Java Introduction • Java History • Why Learn Java • Java Version • Java IDE • Java Features • Java Program Structure • What happens at Compile and Runtime ? • Distinction between JVM, JRE and JDK Session 1: Fundamentals © [email protected] 2
  • 3. • Java is a programming language and a platform. • Java is a high level, robust, secured and object-oriented programming language. Introduction (What java) © [email protected] 3
  • 4. • James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in June 1991. • Firstly, it was called "Greentalk" by James Gosling and file extension was .gt. • After that, it was called Oak and was developed as a part of the Green project. • Why Oak? Oak is a symbol of strength and chosen as a national tree of many countries like U.S.A., France, Germany, Romania etc. (presumably because he liked the look of an oak tree that was right outside his window at Sun). • In 1995, Oak was renamed as "Java" because it was already a trademark by Oak Technologies. • Why java? The team gathered to choose a new name. According to James Gosling "Java was one of the top choices along with Silk". Since java was so unique, most of the team members preferred java. • Java is an island of Indonesia where first coffee was produced (called java coffee). • Originally developed by James Gosling at Sun Microsystems (which is now a subsidiary of Oracle Corporation) and released in 1995. History (How Java) © [email protected] 4
  • 5. Why Java? • Large codebase of already written applications • 9 million of professional Java developers • Lots of enterprise applications were developed and are being developed in Java • The same program can run on different platforms • Mobile Android development is done in Java • According to Sun, 3 billion devices run java. There are many devices where java is currently used. © [email protected] 5
  • 6. • Some of the devices using java are as follows: • Desktop Applications such as acrobat reader, media player, antivirus etc. • Web Applications such as irctc.co.in, javatpoint.com etc. • Enterprise Applications such as banking applications. • Mobile • Embedded System • Smart Card • Robotics • Games etc. Devices using Java © [email protected] 6
  • 7. • There are mainly 4 type of applications that can be created using java programming: • Standalone Application: (J2SE) – Standard Edition It is also known as desktop application or window-based application. An application that we need to install on every machine such as media player, antivirus etc. AWT and Swing are used in java for creating standalone applications. • Web Application: An application that runs on the server side and creates dynamic page, is called web application. Currently, servlet, jsp, struts, jsf etc. technologies are used for creating web applications in java. • Enterprise Application: (J2EE) – Enterprise Edition An application that is distributed in nature, such as banking applications etc. It has the advantage of high level security, load balancing and clustering. In java, EJB is used for creating enterprise applications. • Mobile Application: (J2ME) – Micro Edition An application that is created for mobile devices. Currently Android and Java ME are used for creating mobile applications. Types of Java Applications © [email protected] 7
  • 8. • Simple • Object oriented • Platform independent • Secured • Multi-threaded • Robust • Portable • High Performance Features of Java © [email protected] 8
  • 9. • syntax is based on C++ (so easier for programmers to learn it after C++). • removed many confusing and/or rarely-used features e.g., explicit pointers, operator overloading etc. • No need to remove unreferenced objects because there is Automatic Garbage Collection in java. Simple © [email protected] 9
  • 10. • Object-oriented means we organize our software as a combination of different types of objects that incorporates both data and behaviour. • Object-oriented programming(OOPs) is a methodology that simplify software development and maintenance by providing some rules. • Basic concepts of OOPs are: • Object • Class • Inheritance • Polymorphism • Abstraction • Encapsulation Object Oriented © [email protected] 10
  • 11. • A platform is the hardware or software environment in which a program runs. • There are two types of platforms software-based and hardware-based. • Java provides software-based platform. The Java platform differs from most other platforms in the sense that it's a software-based platform that runs on top of other hardware-based platforms. • It has two components: • Runtime Environment • API(Application Programming Interface) • java is platform independent Java code can be run on multiple platforms e.g.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). Platform Independent © [email protected] 11
  • 13. • Java is secured because: • No explicit pointer • Programs run inside virtual machine sandbox. • Security provided by Java Language • Classloader • adds security by separating the package for the classes of the local file system from those that are imported from network sources. • Bytecode Verifier • checks the code fragments for illegal code that can violate access right to objects. • Security Manager • determines what resources a class can access such as reading and writing to the local disk. Secure © [email protected] 13
  • 14. • A thread is like a separate program, executing concurrently. We can write Java programs that deal with many tasks at once by defining multiple threads. The main advantage of multi-threading is that it shares the same memory. Threads are important for multi-media, Web applications etc. • Robust simply means strong. Java uses strong memory management. There are lack of pointers that avoids security problem. There is automatic garbage collection in java. There is exception handling and type checking mechanism in java. All these points makes java robust. • We may carry the java bytecode to any platform. • Java is faster than traditional interpretation since byte code is "close" to native code still somewhat slower than a compiled language (e.g., C++) Multi-Tasking, Robust, Portable, high performance © [email protected] 14
  • 15. Run First Program • Three steps to run the Java program  Write the program and save it in a file with the name that ends with .java, for example HelloWorld.java  Compile the program using javac compiler which creates HelloWorld.class file, for example javac HelloWorld.java  Run your program: java HelloWorld class HelloWorld { public static void main(String[] args) { System.out.println (“Hello, world!"); } } © [email protected] 15
  • 16. • class keyword is used to declare a class in java. • public keyword is an access modifier which represents visibility, it means it is visible to all. • (if its not public JVM classes might not able to access it) • static is a keyword, if we declare any method as static, it is known as static method. The core advantage of static method is that there is no need to create object to invoke the static method. The main method is executed by the JVM, so it doesn't require to create object to invoke the main method. So it saves memory. • (While JVM tries to execute Java program it doesn't know how to create instance of main class as there is no standard constructor is defined for main class) • void is the return type of the method, it means it doesn't return any value. • (because it doesn't return any thing to caller which is JVM) • main represents startup of the program. • String[] args is used for command line argument. We will learn it later. • System.out.println() is used print statement. We will learn about the internal working of System.out.println statement later. Understanding Keywords © [email protected] 16
  • 17. • At compile time, java file is compiled by Java Compiler and converts the java code into bytecode. • It does not interact with OS What happens at compile time? © [email protected] 17
  • 19. • JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed. • JVMs are available for many hardware and software platforms. JVM, JRE and JDK are platform dependent because configuration of each OS differs. But, Java is platform independent. • The JVM performs following main tasks: • Loads code • Verifies code • Executes code • Provides runtime environment Difference between JVM, JRE and JDK © [email protected] 19
  • 20. • JRE is an acronym for Java Runtime Environment.It is used to provide runtime environment.It is the implementation of JVM. • It physically exists. It contains set of libraries + other files that JVM uses at runtime. • Implementation of JVMs are also actively released by other companies besides Sun Micro Systems. JRE © [email protected] 20
  • 21. • JDK is an acronym for Java Development Kit. • It physically exists.It contains JRE + development tools. JDK © [email protected] 21
  • 22. Java IDE • Integrated Development Environment (IDE) • Makes your work more productive • Includes text editor, compiler, debugger, context sensitive, help, works with different Java SDKs • Most widely used IDEs: • Netbeans (Oracle) • Eclipse (Open) • Intellijidea (Jetbrains) © [email protected] 22
  • 23. • Queries? End of Java Introduction © [email protected] 23