SlideShare uma empresa Scribd logo
1 de 31
WHY
BEGINNINGS
…
• the announcement about Java (and the HotJava browser,
which did not enjoy quite the same success) was made
publicly on May 23rd, 1995, the first official release of the
JDK was on January 23rd, 1996.
• Java celebrated its quarter century birthday on May 23,
2020. Started by James Gosling in 1995
• While Gosling was employed by Sun Microsystems, Java was
originally created for interactive television and devices such
as cable boxes and televisions.
• Given that the television industry was too immature to
support Java-based technologies in 1995,
• Sun Microsystems determined that Java's support for
internet protocols such as HTTP rendered it more suitable
for internet-based applications.
CONTD…
• Java provides a framework for the development of distributed applications
and can be used to create applications that run either on servers and
clients within a network, or on a single computer.
• Today, Java is used to develop web applications, mobile applications,
desktop applications embedded systems, web servers and application
servers, enterprise applications and scientific applications.
• Oracle frequently likes to quote the statistic that there are “nine million”
Java developers in the world.
• Note that Java was initially the product by Sun MicroSystems, on January
27,2010 Oracle brought Sun MicroSystems and hence its product Java was
inherited by Oracle as well.
HIGHEST NUMBER OF
DEVELOPERS
Java is the world's most
popular programming
language amongst
developers as shown in
Figure 1 below:
JAVA FOR
EMERGING
TECHNOLOGI
ES
In a worldwide survey of
2500 developers,
IDC asked about the top
five use cases for which
they have used Java for
emerging technologies as
illustrated in Figure:
Q: WHY DOES JAVA CONTINUE
TO BE SO POPULAR?
• Practicality
• Backwards compatibility
• Scalability/Performance/Reliability
• Java is a platform Independent
• The Byte Code
• Java is Fast
• Java is Portable
PRACTICALITY
• James Gosling has described Java as a “blue collar”
programming language.
• It was designed to allow developers to get their job
done with the minimum of fuss, whilst still
enabling developers to pick up someone else’s (or
even their own) code at a later date and understand
what it’s supposed to do.
• Sure, you can write unreadable code in Java, just as
you can in any language, but with good coding
conventions it is more readable than many other
languages.
BACKWARDS COMPATIBILITY
• Sun and subsequently Oracle have made huge
efforts to ensure that code written for one
version of Java will continue to run unchanged
on newer versions.
• There’s nothing worse than taking code that
works and having to change it to make it work
on a newer version of the platform. That’s just
wasted time.
SCALABILITY/PERFORMANCE/RELIAB
ILITY
• With over twenty years and thousands of man-years of
development, Java is a rock-solid platform thanks to some of the
optimisations made by the JVM using dynamic rather than static
code analysis.
• When it comes to scalability, just look at some of the large
enterprises using Java:
• Twitter (who moved off Ruby-on-Rails to the JVM because RoR
wouldn’t scale),
• Spotify, Facebook, Salesforce, eBay and, of course, Oracle.
Hadoop,
• the basis of most big data projects, are either written in Java and
run on the JVM.
• If you want scalability and performance, Java and the JVM is an
obvious choice.
JAVA IS A PLATFORM
INDEPENDENT
• Platform independent means java can run on
any computer irrespective to the hardware and
software dependency.
• Means Java does not depend on hardware
means what type of processor , RAM etc. Java
will run on a machine which will satisfy its
basic needs .
PLATFORM INDEPENDENCE…
THE BYTE CODE
• The Byte Code Concept separates java from all other language.
• As we know Byte Code is set of symbols created by Sun which are
generated after the compilation of Program.
• This byte code is actually encoded source code that human cannot
understand
• Byte code is converted to machine code by Java Runtime
Environment.(JRE)
• This Byte code is executed by java runtime environment which
consist of Byte code loader which loads the byte code into
memory.
• then Byte code verifier ,which verifies the Byte code and look for
any extra symbols and code which does not resembles to the
standards and throws unexpected code away and makes java byte
code error free and secure.
THE BYTECODE CONCEPT…
JAVA IS FAST
• Java is fast because of JIT compiler.
• Just In Time compiler stores the repeated code
in its cache memory and in byte code where
repeated code is used.
• instead of loading that code again from
memory,
• JIT use it from its cache memory and safe time
and space and make execution fast.
JAVA IS PORTABLE
• Due to its Byte code is in Bytes,
• Java program takes very less memory on hard
disk and therefore java technology is Portable.
WHAT JAVA TECHNOLOGY CAN DO?
• The general-purpose, high-level Java programming
language is a powerful software platform.
• Every full implementation of the Java platform gives you
the following features:
• Development Tools: The development tools provide
everything you'll need for compiling, running, monitoring,
debugging, and documenting your applications. As a new
developer, the main tools you'll be using are
the javac compiler, the java launcher, and
the javadoc documentation tool.
• Application Programming Interface (API): The API provides
the core functionality of the Java programming language. It
offers a wide array of useful classes ready for use in your
own applications. It spans everything from basic objects, to
networking and security, to XML generation and database
access, and more.
JDK EDITIONS
• Java Standard Edition (J2SE)
• J2SE can be used to develop client-side standalone applications or applets.
• Java Enterprise Edition (J2EE)
• J2EE can be used to develop server-side applications such as Java servlets and
Java ServerPages.
• Java Micro Edition (J2ME).
• J2ME can be used to develop applications for mobile devices such as cell
phones.
A SIMPLE JAVA
PROGRAM
//This program prints Welcome to Java!
public class Welcome
{
public static void main(String[] args)
{
System.out.println("Welcome to Java!");
}
}
18
CREATING AND EDITING USING
NOTEPAD
To use NotePad, type
notepad Welcome.java
from the DOS prompt.
19
CREATING, COMPILING, AND
RUNNING PROGRAMS
20
Source Code
Create/Modify Source Code
Compile Source Code
i.e., javac Welcome.java
Bytecode
Run Byteode
i.e., java Welcome
Result
If compilation errors
If runtime errors or incorrect result
public class Welcome {
public static void main(String[] args) {
System.out.println("Welcome to Java!");
}
}
…
Method Welcome()
0 aload_0
…
Method void main(java.lang.String[])
0 getstatic #2 …
3 ldc #3 <String "Welcome to
Java!">
5 invokevirtual #4 …
8 return
Saved on the disk
stored on the disk
Source code (developed by the programmer)
Byte code (generated by the compiler for JVM
to read and interpret, not for you to understand)
COMPILING AND RUNNING
JAVA FROM THE COMMAND
WINDOW
Set path to JDK bin directory
set path=c:Program
Filesjavajdk1.x.xbin
Set classpath to include the current
directory
set classpath=.
Compile
javac Welcome.java
Run
21
ANATOMY OF A JAVA
PROGRAM
•Comments
•Reserved words
•Modifiers
•Statements
•Blocks
•Classes
•Methods
•The main method
22
COMMENTS
Line comment: A line comment is preceded by two
slashes (//) in a line.
Paragraph comment: A paragraph comment is
enclosed between /* and */ in one or multiple lines.
23
javadoc comment: javadoc comments begin with
/** and end with */. They are used for
documenting classes, data, and methods. They
can be extracted into an HTML file using JDK's
javadoc command.
Three types of comments in
Java.
RESERVED WORDS
• Reserved words or keywords are words that have
a specific meaning to the compiler and cannot be
used for other purposes in the program.
• For example, when the compiler sees the word
class, it understands that the word after class is
the name for the class. Other reserved words are
public, static, and void etc.
24
MODIFIERS
• Java uses certain reserved words called
modifiers that specify the properties of the
data, methods, and classes and how they can
be used.
• Examples of modifiers are public and static.
• Other modifiers are private, final, abstract, and
protected.
• A public datum, method, or class can be
accessed by other programs.
• A private datum or method cannot be accessed
by other programs.
25
STATEMENTS
• A statement represents an action or a sequence
of actions.
• The statement System.out.println("Welcome to
Java!") in the program is a statement to display
the greeting
• "Welcome to Java!"
• Every statement in Java ends with a semicolon (;).
26
BLOCKS
27
A pair of braces in a program forms a block
that groups components of a program.
public class Test {
public static void main(String[] args) {
System.out.println("Welcome to Java!");
}
}
Class block
Method block
CLASSES
• The class is the essential Java construct.
• A class is a template or blueprint for
objects.
• To program in Java, you must understand
classes and be able to write and use them.
• A program is defined by using one or more
classes.
28
METHODS
• What is System.out.println?
• It is a method: a collection of statements that
performs a sequence of operations to display a
message on the console.
• It can be used even without fully understanding
the details of how it works. It is used by invoking a
statement with a string argument.
• The string argument is enclosed within
parentheses.
• In this case, the argument is "Welcome to Java!"
You can call the same println method with a
different argument to print a different message.
29
MAIN
METHOD
The main method provides the control of
program flow. The Java interpreter executes the
application by invoking the main method.
The main method looks like this:
public static void main(String[] args)
{
// Statements;
}
30
END OF
LECTURE
31

Mais conteúdo relacionado

Semelhante a 1.Intro--Why Java.pptx

PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptPPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptRajeshSukte1
 
PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptPPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptCDSukte
 
Lecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 FastLecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 FastUzairSaeed18
 
1 Module 1 Introduction.pptx
1 Module 1 Introduction.pptx1 Module 1 Introduction.pptx
1 Module 1 Introduction.pptxBhargaviDalal3
 
JAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxJAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxMurugesh33
 
JAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxJAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxMurugesh33
 
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf10322210023
 
basic core java up to operator
basic core java up to operatorbasic core java up to operator
basic core java up to operatorkamal kotecha
 
Basic javaprogramming(session1)
Basic javaprogramming(session1)Basic javaprogramming(session1)
Basic javaprogramming(session1)Barm Bannasan
 
Introduction to Java Programming.pdf
Introduction to Java Programming.pdfIntroduction to Java Programming.pdf
Introduction to Java Programming.pdfAdiseshaK
 

Semelhante a 1.Intro--Why Java.pptx (20)

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
 
PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptPPS Java Overview Unit I.ppt
PPS Java Overview Unit I.ppt
 
PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.pptPPS Java Overview Unit I.ppt
PPS Java Overview Unit I.ppt
 
Java (1)
Java (1)Java (1)
Java (1)
 
java completed units.docx
java completed units.docxjava completed units.docx
java completed units.docx
 
Lecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 FastLecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 Fast
 
java full 1.docx
java full 1.docxjava full 1.docx
java full 1.docx
 
java full.docx
java full.docxjava full.docx
java full.docx
 
java full 1 (Recovered).docx
java full 1 (Recovered).docxjava full 1 (Recovered).docx
java full 1 (Recovered).docx
 
Unit1 JAVA.pptx
Unit1 JAVA.pptxUnit1 JAVA.pptx
Unit1 JAVA.pptx
 
unit1.pptx
unit1.pptxunit1.pptx
unit1.pptx
 
1 Module 1 Introduction.pptx
1 Module 1 Introduction.pptx1 Module 1 Introduction.pptx
1 Module 1 Introduction.pptx
 
JAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxJAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptx
 
JAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxJAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptx
 
Introduction to JAVA
Introduction to JAVAIntroduction to JAVA
Introduction to JAVA
 
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
1. JAVA_Module_1-edited - AJIN ABRAHAM.pptx.pdf
 
basic core java up to operator
basic core java up to operatorbasic core java up to operator
basic core java up to operator
 
Basic javaprogramming(session1)
Basic javaprogramming(session1)Basic javaprogramming(session1)
Basic javaprogramming(session1)
 
Introduction to Java Programming.pdf
Introduction to Java Programming.pdfIntroduction to Java Programming.pdf
Introduction to Java Programming.pdf
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 

Último

Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 

Último (20)

Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 

1.Intro--Why Java.pptx

  • 1. WHY
  • 2. BEGINNINGS … • the announcement about Java (and the HotJava browser, which did not enjoy quite the same success) was made publicly on May 23rd, 1995, the first official release of the JDK was on January 23rd, 1996. • Java celebrated its quarter century birthday on May 23, 2020. Started by James Gosling in 1995 • While Gosling was employed by Sun Microsystems, Java was originally created for interactive television and devices such as cable boxes and televisions. • Given that the television industry was too immature to support Java-based technologies in 1995, • Sun Microsystems determined that Java's support for internet protocols such as HTTP rendered it more suitable for internet-based applications.
  • 3. CONTD… • Java provides a framework for the development of distributed applications and can be used to create applications that run either on servers and clients within a network, or on a single computer. • Today, Java is used to develop web applications, mobile applications, desktop applications embedded systems, web servers and application servers, enterprise applications and scientific applications. • Oracle frequently likes to quote the statistic that there are “nine million” Java developers in the world. • Note that Java was initially the product by Sun MicroSystems, on January 27,2010 Oracle brought Sun MicroSystems and hence its product Java was inherited by Oracle as well.
  • 4. HIGHEST NUMBER OF DEVELOPERS Java is the world's most popular programming language amongst developers as shown in Figure 1 below:
  • 5. JAVA FOR EMERGING TECHNOLOGI ES In a worldwide survey of 2500 developers, IDC asked about the top five use cases for which they have used Java for emerging technologies as illustrated in Figure:
  • 6. Q: WHY DOES JAVA CONTINUE TO BE SO POPULAR? • Practicality • Backwards compatibility • Scalability/Performance/Reliability • Java is a platform Independent • The Byte Code • Java is Fast • Java is Portable
  • 7. PRACTICALITY • James Gosling has described Java as a “blue collar” programming language. • It was designed to allow developers to get their job done with the minimum of fuss, whilst still enabling developers to pick up someone else’s (or even their own) code at a later date and understand what it’s supposed to do. • Sure, you can write unreadable code in Java, just as you can in any language, but with good coding conventions it is more readable than many other languages.
  • 8. BACKWARDS COMPATIBILITY • Sun and subsequently Oracle have made huge efforts to ensure that code written for one version of Java will continue to run unchanged on newer versions. • There’s nothing worse than taking code that works and having to change it to make it work on a newer version of the platform. That’s just wasted time.
  • 9. SCALABILITY/PERFORMANCE/RELIAB ILITY • With over twenty years and thousands of man-years of development, Java is a rock-solid platform thanks to some of the optimisations made by the JVM using dynamic rather than static code analysis. • When it comes to scalability, just look at some of the large enterprises using Java: • Twitter (who moved off Ruby-on-Rails to the JVM because RoR wouldn’t scale), • Spotify, Facebook, Salesforce, eBay and, of course, Oracle. Hadoop, • the basis of most big data projects, are either written in Java and run on the JVM. • If you want scalability and performance, Java and the JVM is an obvious choice.
  • 10. JAVA IS A PLATFORM INDEPENDENT • Platform independent means java can run on any computer irrespective to the hardware and software dependency. • Means Java does not depend on hardware means what type of processor , RAM etc. Java will run on a machine which will satisfy its basic needs .
  • 12. THE BYTE CODE • The Byte Code Concept separates java from all other language. • As we know Byte Code is set of symbols created by Sun which are generated after the compilation of Program. • This byte code is actually encoded source code that human cannot understand • Byte code is converted to machine code by Java Runtime Environment.(JRE) • This Byte code is executed by java runtime environment which consist of Byte code loader which loads the byte code into memory. • then Byte code verifier ,which verifies the Byte code and look for any extra symbols and code which does not resembles to the standards and throws unexpected code away and makes java byte code error free and secure.
  • 14. JAVA IS FAST • Java is fast because of JIT compiler. • Just In Time compiler stores the repeated code in its cache memory and in byte code where repeated code is used. • instead of loading that code again from memory, • JIT use it from its cache memory and safe time and space and make execution fast.
  • 15. JAVA IS PORTABLE • Due to its Byte code is in Bytes, • Java program takes very less memory on hard disk and therefore java technology is Portable.
  • 16. WHAT JAVA TECHNOLOGY CAN DO? • The general-purpose, high-level Java programming language is a powerful software platform. • Every full implementation of the Java platform gives you the following features: • Development Tools: The development tools provide everything you'll need for compiling, running, monitoring, debugging, and documenting your applications. As a new developer, the main tools you'll be using are the javac compiler, the java launcher, and the javadoc documentation tool. • Application Programming Interface (API): The API provides the core functionality of the Java programming language. It offers a wide array of useful classes ready for use in your own applications. It spans everything from basic objects, to networking and security, to XML generation and database access, and more.
  • 17. JDK EDITIONS • Java Standard Edition (J2SE) • J2SE can be used to develop client-side standalone applications or applets. • Java Enterprise Edition (J2EE) • J2EE can be used to develop server-side applications such as Java servlets and Java ServerPages. • Java Micro Edition (J2ME). • J2ME can be used to develop applications for mobile devices such as cell phones.
  • 18. A SIMPLE JAVA PROGRAM //This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); } } 18
  • 19. CREATING AND EDITING USING NOTEPAD To use NotePad, type notepad Welcome.java from the DOS prompt. 19
  • 20. CREATING, COMPILING, AND RUNNING PROGRAMS 20 Source Code Create/Modify Source Code Compile Source Code i.e., javac Welcome.java Bytecode Run Byteode i.e., java Welcome Result If compilation errors If runtime errors or incorrect result public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); } } … Method Welcome() 0 aload_0 … Method void main(java.lang.String[]) 0 getstatic #2 … 3 ldc #3 <String "Welcome to Java!"> 5 invokevirtual #4 … 8 return Saved on the disk stored on the disk Source code (developed by the programmer) Byte code (generated by the compiler for JVM to read and interpret, not for you to understand)
  • 21. COMPILING AND RUNNING JAVA FROM THE COMMAND WINDOW Set path to JDK bin directory set path=c:Program Filesjavajdk1.x.xbin Set classpath to include the current directory set classpath=. Compile javac Welcome.java Run 21
  • 22. ANATOMY OF A JAVA PROGRAM •Comments •Reserved words •Modifiers •Statements •Blocks •Classes •Methods •The main method 22
  • 23. COMMENTS Line comment: A line comment is preceded by two slashes (//) in a line. Paragraph comment: A paragraph comment is enclosed between /* and */ in one or multiple lines. 23 javadoc comment: javadoc comments begin with /** and end with */. They are used for documenting classes, data, and methods. They can be extracted into an HTML file using JDK's javadoc command. Three types of comments in Java.
  • 24. RESERVED WORDS • Reserved words or keywords are words that have a specific meaning to the compiler and cannot be used for other purposes in the program. • For example, when the compiler sees the word class, it understands that the word after class is the name for the class. Other reserved words are public, static, and void etc. 24
  • 25. MODIFIERS • Java uses certain reserved words called modifiers that specify the properties of the data, methods, and classes and how they can be used. • Examples of modifiers are public and static. • Other modifiers are private, final, abstract, and protected. • A public datum, method, or class can be accessed by other programs. • A private datum or method cannot be accessed by other programs. 25
  • 26. STATEMENTS • A statement represents an action or a sequence of actions. • The statement System.out.println("Welcome to Java!") in the program is a statement to display the greeting • "Welcome to Java!" • Every statement in Java ends with a semicolon (;). 26
  • 27. BLOCKS 27 A pair of braces in a program forms a block that groups components of a program. public class Test { public static void main(String[] args) { System.out.println("Welcome to Java!"); } } Class block Method block
  • 28. CLASSES • The class is the essential Java construct. • A class is a template or blueprint for objects. • To program in Java, you must understand classes and be able to write and use them. • A program is defined by using one or more classes. 28
  • 29. METHODS • What is System.out.println? • It is a method: a collection of statements that performs a sequence of operations to display a message on the console. • It can be used even without fully understanding the details of how it works. It is used by invoking a statement with a string argument. • The string argument is enclosed within parentheses. • In this case, the argument is "Welcome to Java!" You can call the same println method with a different argument to print a different message. 29
  • 30. MAIN METHOD The main method provides the control of program flow. The Java interpreter executes the application by invoking the main method. The main method looks like this: public static void main(String[] args) { // Statements; } 30