SlideShare a Scribd company logo
Java Programming (M&M)
Java is a programming language created by
James Gosling from Sun Microsystem (Sun)
in 1991. The first publicy available version
of Java (Java 1.0) was released in 1995.
Sun microsystems was acquired by the
Oracle Corporation in 2010. Oracle has
now the steermanship for Java.
Java is a high-level language and software-only platform. It
runs on more than 50 million personal computers and on
billions of devices worldwide. 9 million developers have
created Java applications in all major industries.
Java also allows you to play online games, chat with people
around the world, calculate your mortgage interest, and
view images in 3D, just to name a few. It's also integral to
the intranet applications and other e-business solutions
that are the foundation of corporate computing.
Trying to design a very basic
chat room in JAVA RMI. My
design brief is that all clients
messages should be displayed to
other clients and also captured
and displayed on the server. I
have been able to get as far as
getting all client messages to
display on the server side, but I
am having difficulty in being
able to display the messages
sent by clients to other clients. I
have constructed a GUI for
clients in netbeans for them to
type and receive text. Does
anyone know of any ways I can
go about solving this issue?
The Java programming language is a high-level language that
can be characterized by all of the following buzzwords:
• Architecture neutral
•Portable
•High performance
•Robust
•Secure
•Object oriented
•Distributed
•Simple
•Multithreaded
•Dynamic
In the Java programming language, all source code is first
written in plain text files ending with
the .java extension. Those source files are then compiled
into .class files by the javac compiler. A .class file does
not contain code that is native to your processor; it
instead contains bytecodes — the machine language of the
Java Virtual Machine (Java VM). The java launcher tool then
runs your application with an instance of the Java Virtual
Machine.
JAVA LANGUAGE
OR
Java Programming (M&M)
The two main components of
the Java platform are the Java
Application Programming
Interface (API), which is a
library of Java command lines
and the Java Virtual Machine
(JVM) that interprets Java
A platform is the hardware or
software environment in
which a program runs. We've
already mentioned some of
the most popular platforms
like Microsoft Windows,
Linux, Solaris OS, and Mac
OS. Most platforms can be
described as a combination
of the operating system and
underlying hardware. The
Java platform differs from
most other platforms in that
it's a software-only platform
that runs on top of other
hardware-based platforms.
You've already been introduced to the Java
Virtual Machine; it's the base for the Java
platform and is ported onto various hardware-
based platforms.
The API is a large collection of ready-made
software components that provide many useful
capabilities. It is grouped into libraries of related
classes and interfaces; these libraries are known
as packages.
As a platform-independent
environment, the Java
platform can be a bit slower
than native code. However,
advances in compiler and
virtual machine technologies
are bringing performance
close to that of native code
without threatening portability.
10 REASONS WHY JAVA
ROCKS MORE THAN EVER
Part 1: The Java Compilerr
The compiler is one of the things we take
for granted in any language, without
thinking about its great features. In Java,
unlike C++, you can simply compile your
code without thinking too much about
linking, optimisation and all sorts of other
usual compiler features. This is partially
due to the JIT (Just In Time compiler),
which does further compilation work at
runtime. Part 2: The Core API
The JDK’s core API consists of a very
solid, stable and well-understood set of
libraries. While many people complain
about the lack of functionality in this area
(resorting to Google Guava or Apache
Commonss, people often forget that the
core API is still the one that is underneath
all those extensions. Again, from a C++
perspective, this is a truly luxurious
situation.
Part 3: Open Source
In this section, ZeroTurnaround’s
Geert Bevin‘s mind-set aligns well
with our own at Data Geekery when
it comes to the spirit of Open
Source – no matter whether this is
about free-as-in-freedom, or free-as-
in-beer, the point is that so many
things about Java are “open”. We’re
all in this together.
Part 4: The Java Memory Model
Again, a very interesting point of
view from someone with a solid C++
background. We’re taking many
things for granted as Java has had a
very good threading and memory
model from the beginning, which
was corrected only once in the JDK
1.5 in 2004, and which has built a
solid grounds for newer API like
actor-based ones, Fork/JOIN, etc.
Part 5: High-Performance
JVM
The JVM is the most obvious
thing to talk about it has
allowed for so many
languages to work on so
many hardware
environments, and it runs so
fast, nowadays!
Part 6: Bytecode
Bytecode is a vendor-independent
abstraction of machine code, which
is very predi ctable and can be
generated, manipulated, and
transformed by various
technologies. We’ve recently had a
guest post by Dr. Ming-Yee Iu who
has shown how bytecode
transformations can be used to
emulate LINQ in Java. Let’s hear it
Part 7: Intelligent IDEs
15 years ago, developing software worked quite
differently. People can write assembler or C programs
with vi or Notepad. But when you’re writing a very
complex enterprise-scale Java program, you wouldn’t
want to miss IDEs, nowadays. We’ve blogged
about various reasons why SQLJ has died. The lack of
proper IDE support was one of them.
Part 8: Profiling Tools
Remember when Oracle released Java Mission
Control for free developer use with the JDK
7u40? Profiling is something very very
awesome. With modern profilers, you can
know exactly where your bottleneck is by simply
measuring every aspect of your JVM. You don’t
have to guess, you can know.
Part 9: Backwards Compatibility
While backwards-compatibility has
its drawbacks, too, it is still
very impressive how long the Java
language, the JVM, and the JDK have
existed so far without introducing
any major backwards-compatibility
regressions. The only thing that
comes to mind is the introduction
of keywords like assert and enum.
Part 10: Maturity With Innovation
In fact, this article is a summary of all
the others, saying that Java has been a
very well-designed and mature
platform from the beginning without
ever ceasing to innovate. And it’s true.
With Java 8, a great next step has been
published that will – again – change
the way the enterprise perceives
software development for good.
HOW TO WRITE YOUR
FIRST PROGRAM IN JAVA
InordertostartwritingprogramsinJava,setupyour
workenvironment.ManyprogrammersuseIntegrated
DevelopmentEnvironments(IDEs)suchasEclipseand
NetbeansfortheirJavaprogramming,butonecanwrite
aJavaprogramandcompileitwithoutbloatedIDEs.
Any sort of Notepad-like program will
suffice for programming in Java.Hardcore
programmers sometimes prefer to use
text editors that are within the terminal
such as vim and emacs. A very good text
editor that can be installed on both a
Windows machine and on a linux-based
machine (Mac, Ubuntu, etc.) is Sublime
Text, which is what we will be using in
this tutorial.
Make sure that you
have the Java Software
Development
KIT installed. You will
need this for compiling
your program.
We will first create a program that prints
"Hello World." In your text editor, create
a new file and save it as
"HelloWorld.java". HelloWorld is your
class name and you will need your class
name to be the same name as your file.
Declare your class and your main
method. The main method public
static void main(String[] args) is the
method that will be executed when
the programming is running.
Write the line of
code that will
print out "Hello
World."
Put it all
together
Save your file and open
up command prompt or
terminal to compile the
program
Run the
program.
Congratulations,
you have made
your first Java
program!
MATTHEW CALIFF CALIP
MARIFER ABAO
9
S
S
C
N
E
U
M
A
N
N
J
A
V
A
P
R
O
G
R
A
M
M
I
N
G

More Related Content

PDF
130700548484460000
PPTX
Features of java unit 1
PPT
J2ee strutswithhibernate-140121221332-phpapp01
PPT
An introduction to java programming language forbeginners(java programming tu...
PPTX
Java Lecture 1
PPTX
Java v/s .NET - Which is Better?
PPTX
Comparison of Programming Platforms
PDF
PHP, Java EE & .NET Comparison
130700548484460000
Features of java unit 1
J2ee strutswithhibernate-140121221332-phpapp01
An introduction to java programming language forbeginners(java programming tu...
Java Lecture 1
Java v/s .NET - Which is Better?
Comparison of Programming Platforms
PHP, Java EE & .NET Comparison

What's hot (20)

PPTX
PPTX
Java Intro
PPTX
Java ms harsha
PDF
J introtojava1-pdf
PPTX
Programming in Java
PPTX
A Comparison of .NET Framework vs. Java Virtual Machine
PPTX
Core Java
 
DOCX
JAVA First Day
PPT
Java Programming : introduction
PPSX
Industrial Training Report on Java Technology.
PPSX
Java Semimar Slide (Cetpa)
PPTX
Java presentation
PDF
Java Programming Basics
ODP
Jalimo Slides Linuxtag2008
PPTX
Why java is important in programming language?
PPTX
Training on Core java | PPT Presentation | Shravan Sanidhya
DOCX
Industrial Training report on java
PDF
perl-java
PPT
Core Java Slides
Java Intro
Java ms harsha
J introtojava1-pdf
Programming in Java
A Comparison of .NET Framework vs. Java Virtual Machine
Core Java
 
JAVA First Day
Java Programming : introduction
Industrial Training Report on Java Technology.
Java Semimar Slide (Cetpa)
Java presentation
Java Programming Basics
Jalimo Slides Linuxtag2008
Why java is important in programming language?
Training on Core java | PPT Presentation | Shravan Sanidhya
Industrial Training report on java
perl-java
Core Java Slides
Ad

Viewers also liked (11)

PDF
Sunspot Final
PDF
saurav_resume
PDF
NetApp OBIEE Phase 1
PDF
Sun Microsystem OBIEE Strategy
PDF
Sun Microsystems Puppet Case Study
PDF
Monitoring Identity Manager by JMX
PPTX
Sun Microsystems
PPTX
Solaris Operating System - Oracle
PPT
Sun Microsystems:Case Studyv1
PPT
basics of computer system ppt
DOC
Hospital management system
Sunspot Final
saurav_resume
NetApp OBIEE Phase 1
Sun Microsystem OBIEE Strategy
Sun Microsystems Puppet Case Study
Monitoring Identity Manager by JMX
Sun Microsystems
Solaris Operating System - Oracle
Sun Microsystems:Case Studyv1
basics of computer system ppt
Hospital management system
Ad

Similar to Java Programming (M&M) (20)

PPTX
Programming in java ppt
PPTX
Programming in java ppt
PPTX
Java Programming Tutorials Basic to Advanced 1
DOCX
Introduction to java programming tutorial
PPTX
JAVA - Summary Introduction to java .pptx
PDF
Java Basic.pdf
PPSX
JAVA.ppsx java code java edv java development
PPT
PPS Java Overview Unit I.ppt
PPT
PPS Java Overview Unit I.ppt
PPTX
1_Introduction to Java.pptx java programming
PPTX
PPTX
PPTX
PPTX
PPTX
PPTX
PDF
Technology Tutorial.pdf
PDF
TechSearchWeb.pdf
PDF
what is java.pdf
PPTX
Object Oriented Programming Part 1 of Unit 1
Programming in java ppt
Programming in java ppt
Java Programming Tutorials Basic to Advanced 1
Introduction to java programming tutorial
JAVA - Summary Introduction to java .pptx
Java Basic.pdf
JAVA.ppsx java code java edv java development
PPS Java Overview Unit I.ppt
PPS Java Overview Unit I.ppt
1_Introduction to Java.pptx java programming
Technology Tutorial.pdf
TechSearchWeb.pdf
what is java.pdf
Object Oriented Programming Part 1 of Unit 1

Recently uploaded (20)

PPTX
Onica Farming 24rsclub profitable farm business
PPTX
Cell Structure & Organelles in detailed.
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Pre independence Education in Inndia.pdf
PDF
Insiders guide to clinical Medicine.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Electrolyte Disturbances and Fluid Management A clinical and physiological ap...
PPTX
Cardiovascular Pharmacology for pharmacy students.pptx
PPTX
NOI Hackathon - Summer Edition - GreenThumber.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
PSYCHOLOGY IN EDUCATION.pdf ( nice pdf ...)
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PPTX
Open Quiz Monsoon Mind Game Prelims.pptx
PDF
Open folder Downloads.pdf yes yes ges yes
PDF
English Language Teaching from Post-.pdf
Onica Farming 24rsclub profitable farm business
Cell Structure & Organelles in detailed.
Renaissance Architecture: A Journey from Faith to Humanism
human mycosis Human fungal infections are called human mycosis..pptx
Pre independence Education in Inndia.pdf
Insiders guide to clinical Medicine.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
Electrolyte Disturbances and Fluid Management A clinical and physiological ap...
Cardiovascular Pharmacology for pharmacy students.pptx
NOI Hackathon - Summer Edition - GreenThumber.pptx
Anesthesia in Laparoscopic Surgery in India
O5-L3 Freight Transport Ops (International) V1.pdf
PSYCHOLOGY IN EDUCATION.pdf ( nice pdf ...)
01-Introduction-to-Information-Management.pdf
Week 4 Term 3 Study Techniques revisited.pptx
Open Quiz Monsoon Mind Game Prelims.pptx
Open folder Downloads.pdf yes yes ges yes
English Language Teaching from Post-.pdf

Java Programming (M&M)

  • 2. Java is a programming language created by James Gosling from Sun Microsystem (Sun) in 1991. The first publicy available version of Java (Java 1.0) was released in 1995. Sun microsystems was acquired by the Oracle Corporation in 2010. Oracle has now the steermanship for Java.
  • 3. Java is a high-level language and software-only platform. It runs on more than 50 million personal computers and on billions of devices worldwide. 9 million developers have created Java applications in all major industries. Java also allows you to play online games, chat with people around the world, calculate your mortgage interest, and view images in 3D, just to name a few. It's also integral to the intranet applications and other e-business solutions that are the foundation of corporate computing.
  • 4. Trying to design a very basic chat room in JAVA RMI. My design brief is that all clients messages should be displayed to other clients and also captured and displayed on the server. I have been able to get as far as getting all client messages to display on the server side, but I am having difficulty in being able to display the messages sent by clients to other clients. I have constructed a GUI for clients in netbeans for them to type and receive text. Does anyone know of any ways I can go about solving this issue?
  • 5. The Java programming language is a high-level language that can be characterized by all of the following buzzwords: • Architecture neutral •Portable •High performance •Robust •Secure •Object oriented •Distributed •Simple •Multithreaded •Dynamic In the Java programming language, all source code is first written in plain text files ending with the .java extension. Those source files are then compiled into .class files by the javac compiler. A .class file does not contain code that is native to your processor; it instead contains bytecodes — the machine language of the Java Virtual Machine (Java VM). The java launcher tool then runs your application with an instance of the Java Virtual Machine.
  • 7. OR
  • 9. The two main components of the Java platform are the Java Application Programming Interface (API), which is a library of Java command lines and the Java Virtual Machine (JVM) that interprets Java
  • 10. A platform is the hardware or software environment in which a program runs. We've already mentioned some of the most popular platforms like Microsoft Windows, Linux, Solaris OS, and Mac OS. Most platforms can be described as a combination of the operating system and underlying hardware. The Java platform differs from most other platforms in that it's a software-only platform that runs on top of other hardware-based platforms.
  • 11. You've already been introduced to the Java Virtual Machine; it's the base for the Java platform and is ported onto various hardware- based platforms. The API is a large collection of ready-made software components that provide many useful capabilities. It is grouped into libraries of related classes and interfaces; these libraries are known as packages. As a platform-independent environment, the Java platform can be a bit slower than native code. However, advances in compiler and virtual machine technologies are bringing performance close to that of native code without threatening portability.
  • 12. 10 REASONS WHY JAVA ROCKS MORE THAN EVER Part 1: The Java Compilerr The compiler is one of the things we take for granted in any language, without thinking about its great features. In Java, unlike C++, you can simply compile your code without thinking too much about linking, optimisation and all sorts of other usual compiler features. This is partially due to the JIT (Just In Time compiler), which does further compilation work at runtime. Part 2: The Core API The JDK’s core API consists of a very solid, stable and well-understood set of libraries. While many people complain about the lack of functionality in this area (resorting to Google Guava or Apache Commonss, people often forget that the core API is still the one that is underneath all those extensions. Again, from a C++ perspective, this is a truly luxurious situation.
  • 13. Part 3: Open Source In this section, ZeroTurnaround’s Geert Bevin‘s mind-set aligns well with our own at Data Geekery when it comes to the spirit of Open Source – no matter whether this is about free-as-in-freedom, or free-as- in-beer, the point is that so many things about Java are “open”. We’re all in this together. Part 4: The Java Memory Model Again, a very interesting point of view from someone with a solid C++ background. We’re taking many things for granted as Java has had a very good threading and memory model from the beginning, which was corrected only once in the JDK 1.5 in 2004, and which has built a solid grounds for newer API like actor-based ones, Fork/JOIN, etc.
  • 14. Part 5: High-Performance JVM The JVM is the most obvious thing to talk about it has allowed for so many languages to work on so many hardware environments, and it runs so fast, nowadays! Part 6: Bytecode Bytecode is a vendor-independent abstraction of machine code, which is very predi ctable and can be generated, manipulated, and transformed by various technologies. We’ve recently had a guest post by Dr. Ming-Yee Iu who has shown how bytecode transformations can be used to emulate LINQ in Java. Let’s hear it
  • 15. Part 7: Intelligent IDEs 15 years ago, developing software worked quite differently. People can write assembler or C programs with vi or Notepad. But when you’re writing a very complex enterprise-scale Java program, you wouldn’t want to miss IDEs, nowadays. We’ve blogged about various reasons why SQLJ has died. The lack of proper IDE support was one of them. Part 8: Profiling Tools Remember when Oracle released Java Mission Control for free developer use with the JDK 7u40? Profiling is something very very awesome. With modern profilers, you can know exactly where your bottleneck is by simply measuring every aspect of your JVM. You don’t have to guess, you can know.
  • 16. Part 9: Backwards Compatibility While backwards-compatibility has its drawbacks, too, it is still very impressive how long the Java language, the JVM, and the JDK have existed so far without introducing any major backwards-compatibility regressions. The only thing that comes to mind is the introduction of keywords like assert and enum. Part 10: Maturity With Innovation In fact, this article is a summary of all the others, saying that Java has been a very well-designed and mature platform from the beginning without ever ceasing to innovate. And it’s true. With Java 8, a great next step has been published that will – again – change the way the enterprise perceives software development for good.
  • 17. HOW TO WRITE YOUR FIRST PROGRAM IN JAVA InordertostartwritingprogramsinJava,setupyour workenvironment.ManyprogrammersuseIntegrated DevelopmentEnvironments(IDEs)suchasEclipseand NetbeansfortheirJavaprogramming,butonecanwrite aJavaprogramandcompileitwithoutbloatedIDEs. Any sort of Notepad-like program will suffice for programming in Java.Hardcore programmers sometimes prefer to use text editors that are within the terminal such as vim and emacs. A very good text editor that can be installed on both a Windows machine and on a linux-based machine (Mac, Ubuntu, etc.) is Sublime Text, which is what we will be using in this tutorial. Make sure that you have the Java Software Development KIT installed. You will need this for compiling your program. We will first create a program that prints "Hello World." In your text editor, create a new file and save it as "HelloWorld.java". HelloWorld is your class name and you will need your class name to be the same name as your file. Declare your class and your main method. The main method public static void main(String[] args) is the method that will be executed when the programming is running. Write the line of code that will print out "Hello World." Put it all together Save your file and open up command prompt or terminal to compile the program Run the program. Congratulations, you have made your first Java program!
  • 18. MATTHEW CALIFF CALIP MARIFER ABAO 9 S S C N E U M A N N J A V A P R O G R A M M I N G