Java.pdf
(
457 KB
)
Pobierz
Ch.12 - Java
1 What is Java?
2 Java is platform independent
3 Applets can be distributed by WWW
4 Example of an applet
5 The Java Language
6 Java is secure
7 Java in four versions
8 Java standard library
9 Event handling in Java
10 Java Beans
11 Different types of integration
12 Java Commerce API
13 Java Telephony API
14 Alternatives to Java
1
Ch.12 - Java
What's Java, really? Well, first one might say that it's a good object oriented programming
language, where the best of other languages is extracted and put together with some own
supplements, for example the security model which is important to Internet applications.
Java has an extensive standard library of classes, making the programming a lot more
effective. There is support for network communication, windows management, file
management, audio and video, security, data access etc.
When the source code in the Java language is compiled, the Java byte code is created. The
byte code is a low-level language, consisting of machine instructions for the Java Virtual
Machine. The byte code makes Java independent of any platform.
The Java Virtual Machine is an abstract computer, on which the byte code can execute.
The Java Virtual Machine becomes a middle-level between the byte code and any operating
system, so, seen from the byte code's perspective, it's always running on the same
computer. The Java Virtual Machine has up to now been implemented as software for the
operating systems Windows NT, Windows 95, Solaris, and MacOS. For faster performance,
Java Virtual Machine will be made in silicone.
2
Ch.12 - Java
This picture shows that the source code written by the programmer and the byte code are
the same for all platforms. The source code may be compiled on different platforms such as
Pentium, PowerPC, SPARC and so on, but the result is always the same Java byte code.
The byte code may be executed on different Java Virtual Machines. The difference between
Java and other programming languages is that the source code doesn't have to be re-written
for different operating systems, nor for new processors.
3
Ch.12 - Java
An applet is a Java byte code that can be distributed through the World Wide Web and used
in a Web page.
What we see here is a server, the World Wide Web, and a client. On the server machine there
is a Web-server, capable of sending HTML-pages and adjoining files. The client machine has
a Web-browser.
When the user clicks on a link to a page containing a reference to an applet, the browser will
download both the page and the applet. Then it will present the page to the user and start
the applet. In order to run, the applet needs a Java Virtual Machine. Most modern Web-
browsers have a Java Virtual Machine built in, and since almost everyone surfing the Net has
a browser, they also have a Java Virtual Machine.
Since the user has downloaded an applet in the Web-browser on his own computer, he has
new possibilities for interactivity, directly on the client. Compare this to using the old CGI-
technique, where interaction would have demanded intensive network traffic between the
client and server.
There is also a possibility of having more than one Java applet for a Web page. These Java
applets can communicate with each other.
The applets may also read parameters from the HTML page itself; in that case there is a
possibility to affect certain settings of an applet by using different HTML pages. An
example is an applet giving different layout to text on the HTML page, the text and the
layout settings could both be parameters in the HTML page red by the applet
To keep a high level of security, in order to stop the spreading of viruses, Netscape and
Microsoft both chose to strongly limit what an applet is allowed to do. It may not, for
example, communicate with a different computer than the one from which it was
downloaded. Also, it may not read nor write on any file in the client machine.
4
Ch.12 - Java
Here is link to an example of an applet. This is a free applet that runs on a client machine,
that is, it has no communication with the server after getting downloaded.
Click on the link "Go to Snake Game"
http://www.halcyon.com/mach/java/wormgame/wormpage.htm
and test it. Don't forget to return when you have finished the testing.
5
Plik z chomika:
musli_com
Inne pliki z tego folderu:
Big Java Late Objects [Horstmann 2012-02-01].pdf
(167477 KB)
Data Structures_ Abstraction and Design using Java (2nd ed.) [Koffman & Wolfgang 2010-01-26].pdf
(190252 KB)
Big Java Early Objects (5th ed.) [Horstmann 2013-01-04].pdf
(145099 KB)
Data Abstraction and Problem Solving with Java_ Walls and Mirrors (3rd ed.) [Prichard & Carrano 2010-10-30] (photocopier quality).pdf
(110506 KB)
A Little Java, a Few Patterns [Felleisen & Friedman 1997-12-19].pdf
(14847 KB)
Inne foldery tego chomika:
3D Design - Programming
ActionScript
Actionscript - Flash - Flex - Air
Ada
ADO
Zgłoś jeśli
naruszono regulamin