📄 intro.html
字号:
<!-- All material contained herein is copyright (c) McGraw-Hill Professional Books
All Rights Reserved. No use of this material may be made without express written
permission of the copyright holder. HTML conversions by Mega Space [barry@megaspace.com] -->
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
<TITLE>Understanding Digital Signatures: Inside the Java Virtual Machine
by Bill Venners - Beta Version</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<TABLE BORDER="0" WIDTH="100%">
<TR><TD><A HREF="http://www.pbg.mcgraw-hill.com/betabooks/stores.html" tppabs="http://www.pbg.mcgraw-hill.com/betabooks/stores.html" target="bottom"><IMG SRC="hotkey.gif" tppabs="http://www.pbg.mcgraw-hill.com/betabooks/images/hotkey.gif" ALIGN="LEFT" BORDER="0" WIDTH="40" HEIGHT="40" ALT="Orders"></A>
<IMG SRC="order_text.gif" tppabs="http://www.pbg.mcgraw-hill.com/betabooks/images/order_text.gif" WIDTH="103" HEIGHT="41" ALT="Orders"></TD>
<TD ALIGN="RIGHT"><A HREF="preface.html" tppabs="http://www.pbg.mcgraw-hill.com/betabooks/venners/preface.html"><IMG SRC="backward.gif" tppabs="http://www.pbg.mcgraw-hill.com/betabooks/images/backward.gif" BORDER="0" ALT="Backward" WIDTH="32" HEIGHT="32"></A> <A HREF="chap01.html" tppabs="http://www.pbg.mcgraw-hill.com/betabooks/venners/chap01.html"><IMG SRC="forward.gif" tppabs="http://www.pbg.mcgraw-hill.com/betabooks/images/forward.gif" BORDER="0" ALT="Forward" WIDTH="32" HEIGHT="32"></A></TD></TR>
<TR><TD COLSPAN="2"><A HREF="mailto:computing@mcgraw-hill.com"><IMG SRC="hotkey.gif" tppabs="http://www.pbg.mcgraw-hill.com/betabooks/images/hotkey.gif" ALIGN="LEFT" BORDER="0" WIDTH="40" HEIGHT="40" ALT="Comments"></A>
<IMG SRC="comment_text.gif" tppabs="http://www.pbg.mcgraw-hill.com/betabooks/images/comment_text.gif" WIDTH="73" HEIGHT="39" ALT="Comments"></TD></TR>
<TR><TD COLSPAN="2"><FONT FACE="ARIEL,HELVETICA" SIZE="-1"><I>© 1997 The McGraw-Hill Companies, Inc. All rights reserved. <BR>Any use of this Beta Book is subject to the rules stated in the <A HREF="http://www.mcgraw-hill.com/corporate/news_info/copyrttm.htm" tppabs="http://www.mcgraw-hill.com/corporate/news_info/copyrttm.htm" target="_top">Terms of Use</A>.</I></FONT></TD></TR>
</TABLE>
<HR>
<P><H1>Introduction</H1></P>
<P>This book describes the Java Virtual Machine, the abstract computer on which all Java programs run. Through a combination of tutorial explanations, working examples, reference material, and applets that interactively illustrate the concepts presented in the text, this book provides an in-depth, technical survey of Java as a technology.</P>
<P>The Java programming language seems poised to be the next popular language for mainstream commercial software development, the next step after C and C++. One of the fundamental reasons Java is a likely candidate for this role is that Java韘 architecture helps programmers deal with emerging hardware realities. Java has features that the shifting hardware environment is demanding, features that are made possible by the Java Virtual Machine.</P>
<P>The evolution of programming languages has to a great extent been driven by changes in the hardware being programmed. As hardware has grown faster, cheaper, and more powerful, software has become larger and more complex. The migration from assembly languages to procedural languages, such as C, and to object oriented languages, such as C++, was largely driven by a need to manage ever greater complexity--complexity made possible by increasingly powerful hardware.</P>
<P>Today the progression towards cheaper, faster, and more powerful hardware continues, as does the need for managing increasing software complexity. Building on C and C++, Java helps programmers deal with complexity by rendering impossible certain kinds of bugs that frequently plague C and C++ programmers. Java韘 inherent memory safety--garbage collection, lack of pointer arithmetic, run-time checks on the use of references--prevents most memory bugs from ever occurring. Java韘 memory safety makes programmers more productive and helps them manage complexity.</P>
<P>In addition, besides the ongoing increase in the capabilities of hardware, there is another fundamental shift taking place in the hardware environment--the network. As networks interconnect more and more computers and devices, new demands are being made on software. With the rise of the network, platform independence and security have become much more important than they were in the past.</P>
<P>The Java Virtual Machine is responsible for the memory safety, platform neutrality, and security features of the Java programming language. Although virtual machines have been around for a long time, prior to Java they hadn韙 quite entered the mainstream. But given today韘 emerging hardware realities, software developers needed a programming language with a virtual machine, and Sun hit the market window with Java.</P>
<P>Thus, the Java Virtual Machine embodies the right software "stuff" for the coming years of computing. This book will help you get to know this virtual machine, and armed with this knowledge, you韑l know how best to put the Java Virtual Machine to use in your programs.</P>
<H3><EM><P>Who Should Read the Book</P>
</EM></H3><P>This book is aimed primarily at professional software developers and students who want to understand Java technology. I assume you are familiar, though not necessarily proficient, with the Java language. Reading this book should help you add a depth to your knowledge of Java programming. If you are one of the elite few who are actually writing Java compilers or creating implementations of the Java Virtual Machine, this book can serve as a companion to the Java Virtual Machine specification. Where the specification specifies, this book explains.</P>
<H3><EM><P>How to Use the Book</P>
</EM></H3><P>This book has five basic parts:</P>
<OL><LI>An introduction to Java韘 architecture (Chapters 1 through 4)</P>
<LI>An in-depth, technical tutorial of Java internals (Chapters 5 through 20)</P>
<LI>A class file and instruction set reference (Chapter 6, Appendices A through C)</P>
<LI>Interactive illustrations, example source code, and the JDK (On the CD-ROM)</P>
<LI>The Resources Web Site (<FONT FACE="Courier New">http://www.artima.com/insidejvm</FONT>)</OL>
<H3><P>An Introduction to Java韘 Architecture</P>
</H3><P>Chapters 1 through 4 (Part I of this book) give an overview of Java韘 architecture, including the motivations behind--and the implications of--Java韘 architectural design. These chapters show how the Java Virtual Machine relates to the other components of Java韘 architecture: the class file, API, and language. If you want a basic understanding of Java as a technology, consult these chapters. Here are some specific points of interest from this portion of the book:</P>
<UL><LI> For an overview of Java韘 architecture and a discussion of its inherent tradeoffs, see Chapter 1, "Introduction to Java韘 Architecture."
<LI> For a discussion of what "platform independence" really means, how Java韘 architecture supports it, and seven steps to take to create a platform independent Java program, see Chapter 2, "Platform Independence."
<LI> For a description of the security model built into Java韘 core architecture, including a tutorial explaining how to write a security-minded class loader, see Chapter 3, "Security."
<LI> For a discussion of the new paradigm of network-mobile software, see Chapter 4, "Network Mobility."</UL>
<H3><P>A Tutorial of Java Internals</P>
</H3><P>Chapters 5 through 20 (Part II of this book) give an in-depth technical description of the inner workings of the Java Virtual Machine. These chapters will help you understand how Java programs actually work. All the material in Part II is presented in a tutorial manner, with lots of examples. Here are some specific points of interest from this portion of the book:</P>
<UL><LI> For a comprehensive overview of the inner workings of the Java Virtual Machine, see Chapter 5, "The Java Virtual Machine."
<LI> If you are parsing, generating, or simply peering into Java class files, see Chapter 6, "The Java Class File," for a complete tutorial and reference on the class file format.
<LI> For a discussion of the lifetime of a class inside the Java Virtual Machine, including the circumstances in which classes can be unloaded, see Chapter 7, "The Lifetime of a Class."
<LI> For a thorough explanation of Java韘 linking model, including a tutorial and examples on writing your own class loaders, see Chapter 8, "The Linking Model."
<LI> For a discussion of garbage collection and finalization, and suggestions on how to use finalizers, see Chapter 9, "Garbage Collection."
<LI> For a tutorial on the Java Virtual Machine韘 instruction set, read Chapters 10 through 20.
<LI> For an explanation of monitors and how you can use them to write thread-safe Java code, see Chapter 20, "Thread Synchronization."</UL>
<H3><P>A Class File and Instruction Set Reference</P>
</H3><P>In addition to being a tutorial on the Java class file, Chapter 6, "The Java Class File," serves as a complete reference of the class file format. Similarly, Chapters 10 through 20 form a tutorial of the Java Virtual Machine韘 instruction set, and Appendices A through C serve as a complete reference of the instruction set. If you need to look something up, check out these chapters and the appendices.</P>
<H3><P>Interactive Illustrations, Example Source Code, and the JDK</P>
</H3><P>For most of this book韘 chapters, material associated with the chapter--such as example code or simulation applets--appears on the CD-ROM.</P>
<P>The <FONT FACE="Courier New">applets</FONT> directory of the CD-ROM contains a mini-website that includes 14 Java applets that illustrate the concepts presented in the text. These "interactive illustrations" form an integral part of this book. Ten of the applets simulate the Java Virtual Machine executing bytecodes. The other applets illustrate garbage collection, two韘-complement and IEEE 754 floating point numbers, and the loading of class files. The applets can be viewed on any platform by any Java-capable browser. The source code for the simulation applets is also included on the CD-ROM.</P>
<P>The copyright notice accompanying the HTML, .java, and .class files for the mini-website enables you to post the mini-website on any network, including the internet, providing you adhere to a few simple rules. For example, you must post the mini-website in its entirety, you can韙 make any changes to it, and you can韙 charge people to look at it. The full text of the copyright notice is given later in this introduction.</P>
<P>All the example source code shown in this book appears on the CD-ROM in both source and compiled (class files) form. If some example code in the text strikes you as interesting (or dubious), you can try it out for yourself.</P>
<P>Most of the example code is illustrative and not likely to be of much practical use besides helping you to understand Java. Nevertheless, you are free to cut and paste from the example code, use it in your own programs, and distribute it in binary (such as Java class file) form. The full text of the copyright notice for the example source code is shown later in this introduction.</P>
<P>Besides the interactive illustrations and example source code, the CD-ROM contains one last item: a full distribution of version 1.1.3 of Sun韘 JDK. This is contained in the CD-ROM韘 <FONT FACE="Courier New">jdk</FONT> directory. </P>
<H3><P>The Resources Web Site</P>
</H3><P>To help you find more information and keep abreast of changes, I maintain a "Resources Web Site" with links to further reading about the material presented in this book. There is at least one "resources page" for each chapter in the book. The main URL of the Resources Web Site is <FONT FACE="Courier New">http://www.artima.com/insidejvm</FONT>. The URL for each chapter韘 individual resources page is given at the end of each chapter in the "The Resources Page" section.</P>
<P><H2><EM>Chapter by Chapter Summary</EM></H2></P>
<P><H2>Part One: Java韘 Architecture</H2></P>
<P><H3>Chapter 1. Introduction to Java韘 Architecture</H3></P>
<P>This chapter gives an introduction to Java as a technology. It gives an overview of Java韘 architecture, discusses why Java is important, and looks at Java韘 pros and cons.</P>
<P><H3>Chapter 2. Platform independence</H3></P>
<P>This chapter shows how Java韘 architecture enables programs to run on any platform, discusses the factors that determine the true portability of Java programs, and looks at the relevant tradeoffs.</P>
<P><H3>Chapter 3. Security</H3></P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -