Software Development 2
Software Development 2
Software Development 2
SOFTWARE DEVELOPMENT 2
Software Development 2 Bell College
1: INTRODUCTION TO JAVA
What is Java?
The Java programming language is a high-level object-oriented language which was
developed by Sun Microsystems. Like other object oriented languages, Java programs
use classes and objects. In this course you will learn what these are and how to use
them.
You write and compile your program once, and it will run on any platform that has a
JVM.
Disadvantage: Java can be slower than other languages as it is interpreted rather than
native machine code. It is possible to compile Java programs to native code for specific
processors, and some Java development tools allow this, but the cross platform
capability is then lost.
• The JVM
The JVM provides the environment on which Java programs can run. The API provides
a large collection of software components, or classes, which the programmer can
include in programs. These provide a wide range of capabilities, e.g. user interface
components, networking components, and many more. These components are
organised in packages.
The Java platforms are available for most combinations of operating systems and
processors, including Windows, Unix, Linux, MacOS, and also for other more specialised
systems such as embedded processors in devices such as mobile phones and handheld
computers. For each system, there are runtime and development versions of the Java
platform:
This provides the JVM and the core Java classes. If you want to simply run existing Java
programs on a system, then it is sufficient to have a JRE installed on the system.
This includes the JRE, together with compilers and debuggers and other development
tools. If you want to develop Java programs, a JDK must be installed on your system.
Applications
An application is a standalone program which runs on a JVM. It can produce text output
to a command console, or it can have a graphical interface similar to a Visual Basic
application. Graphical Java applications use the user interface components provided by
the JVM, and look the same on any platform. .
Applets
An applet is a program designed to run inside a web browser. A web page will have an
area set aside to display the output from an applet, and the applet is downloaded over
the web and runs in the browser. The output is usually graphical, and can use some of
the same user interface components as an application.
Web Applications
A web application is a program which runs on a web server. Java web applications use
technologies called servlets and Java Server Pages (JSP). Web applications are often
used in web sites which interact with databases.
A source file can be created using the text editor and saved as a .java file. The JDK
provides a compiler which can be run from a command line prompt to create a .class
file. The .class file can then be executed from the command prompt.
In this course we will use BlueJ, an IDE which has been specifically designed for
learning Java.
EXERCISE
Go to Sun’s Java web site at http://java.sun.com and find out the answers to the
following:
1. The first version of Java was version 1.0. What is the current version?
2. What editions of Java are available?
3. Search the online J2SE documentation for the System class – can you see what
version of the JDK this class was introduced in? (The Java documentation is very
useful when you are programming – it is a good idea to get to know where to look
right from the start!)