📄 00000000.htm
字号:
9: java.net <BR> 9.1: How do I convert a numeric IP address like 199.1.32.90 into a hostname like <BR> star.blackstar.com? <BR> 9.2: How can a Java program talk to a CGI program? <BR> 9.3: How can an applet send email? <BR> 9.4: How can I use ICMP in Java? <BR> 10: java.util <BR> 10.1: How random is Random()? <BR> 10.2: How do I generate a random integer between a and b? <BR> 11: Common Errors and Problems <BR> 11.1: How Can I Avoid Flicker in an Applet? <BR> 11.2: Can you explain CLASSPATH? <BR> 11.3: Why won't my audio clip play? <BR> 11.4: When I load the page Netscape gives me a java.lang.ClassFormatError. <BR> 11.5: Netscape gives me "Applet Not Initialized Error" <BR> 11.6: Other Netscape Problems <BR> 11.7: I keep getting access privilege violations, " Java tried to read file foo.class in <BR> directory bar." <BR> 11.8: Javac keeps insisting that it can't find the right constructor function in my class, <BR> but I'm sure it's in a file I imported. Why is it even looking in my class instead of the <BR> imported file? <BR> 11.9: NullPointerExceptions with arrays of objects <BR> 11.10: Can't make static reference to method type myMethod in class myClass <BR> 11.11: Why do I have trouble when using == to compare Strings? <BR> 12: Security <BR> 12.1: System Level Security <BR> 12.2: User Level Security <BR> 13: Tools <BR> 13.1: IDE <BR> 13.2: Debugger <BR> 13.3: Editors <BR> 13.4: YACC grammar <BR> 13.5: Profilers <BR> 14: The Java Virtual Machine and Byte <BR> 14.1: Can I program directly in byte code? <BR> 14.2: Optimizing Java <BR> 15: Legal Issues <BR> 16: FAQ's about the FAQ <BR> 16.1: Who is this Elliotte guy, and just what qualified him to write a Java FAQ <BR> anyway? <BR> 16.2: Why don't you include X in your FAQ? <BR> 16.3: This is really cool. Can I republish or translate it? <BR> <BR>1: What is Java? <BR> <BR>Java, formerly known as oak, is an object-oriented programming language developed by Sun. It <BR>shares many superficial similarities with C, C++, and Objective C (for instance for loops have the <BR>same syntax in all four languages); but it is not based on any of those languages, nor have efforts <BR>been made to make it compatible with them. <BR> <BR>Java is sometimes referred to as C++ ++ --. The language was originally created because C++ <BR>proved inadequate for certain tasks. Since the designers were not burdened with compatibility with <BR>existing languages, they were able to learn from the experience and mistakes of previous <BR>object-oriented languages. They added a few things C++ doesn't have like garbage collection and <BR>multithreading; and they threw away C++ features that had proven to be better in theory than in <BR>practice like multiple inheritance and operator overloading. (There's still argument over whether <BR>they made the right choices. I tend to think they were correct to throw out operator overloading <BR>and probably correct to throw out multiple inheritance. For now let's just say that neither choice is <BR>likely to be reviewed soon.) <BR> <BR>Even more importantly Java was designed from the ground up to allow for secure execution of <BR>code across a network, even when the source of that code was untrusted and possibly malicious. <BR>This required the elimination of more features of C and C++. Most notably there are no pointers in <BR>Java. Java programs cannot (at least in theory) access arbitrary addresses in memory. <BR> <BR>Furthermore Java was designed not only to be cross-platform in source form like C, but also in <BR>compiled binary form. Since this is frankly impossible across processor architectures, Java is <BR>compiled to an intermediate byte-code which is interpreted on the fly by the Java interpreter. Thus <BR>to port Java programs to a new platform all that is needed is a port of the interpreter and a few <BR>native code libraries. <BR> <BR>Finally Java was designed to make it a lot easier to write bugfree code. Shipping C code has, on <BR>average, one bug per 55 lines of code. About half of these bugs are related to memory allocation <BR>and deallocation. Thus Java has a number of features to make bugs less common: <BR> <BR> Strong Typing <BR> No unsafe constructs <BR> The language is small so its easy to become fluent. <BR> The language is easy to read and write. Obfuscated Java isn't nearly as common as <BR> obfuscated C. <BR> There are no undefined or architecture dependent constructs. <BR> Java is object oriented so reuse is easy. <BR> Java has concurrency. <BR> <BR>1.1: Where did Java come from? <BR> <BR>In the late 1970's Bill Joy thought about doing a language that would merge the best features of <BR>MESA and C. However other projects (like cofounding Sun) intervened. In the late 1980's he got <BR>Sun's engineers started on a complete revision of the UNIX operating system that involved <BR>merging SunOS4.x with AT&T's SYSVR4. <BR> <BR>In 1989 Joy sold his Sun stock, invested heavily in Microsoft and moved out of mainstream Sun to <BR>Aspen, Colorado. By the early 90's Bill was getting tired of huge programs. He decided that he <BR>wanted to be able to write a 10,000 line program that made a difference. In late 1990 Bill wrote a <BR>paper called Further which outlined his pitch to Sun engineers that they should produce an object <BR>environment based on C++. Today Joy freely admits that C++ was too complicated and wasn't up <BR>to the job. <BR> <BR>Around this time James Gosling (of emacs fame) had been working for several months on an <BR>SGML editor called "Imagination" using C++. The Oak language (now Java) grew out of Gosling's <BR>frustration with C++ on his "Imagination" project. <BR> <BR>Patrick Naughton, then of Sun, now vice-president of technology at StarWave, started the Green <BR>Project on December 5th, 1990. Naughton defined the project as an effort to "do fewer things <BR>better". That December he recruited Gosling and Mike Sheridan to help start the project. Joy <BR>showed them his Further paper, and work began on graphics and user interface issues for several <BR>months in C. <BR> <BR>In April of 1991 the Green Project (Naughton, Gosling and Sheridan) settled on smart consumer <BR>electronics as the delivery platform, and Gosling started working in earnest on Oak. Gosling wrote <BR>the original compiler in C; and Naughton, Gosling and Sheridan wrote the runtime-interpreter, <BR>also in C. (The Green project never wrote a single line of C++.) Oak was running its first programs <BR>in August of 1991. Joy got his first demos of the system that winter, when Gosling and Naugton <BR>went skiing at Joy's place in Aspen. <BR> <BR>By the fall of 1992 "*7", a cross between a PDA and a remote control, was ready This was demoed <BR>to Scott McNealy, Sun's president, in October. He was blown away. Following that the Green <BR>Project was set up as First Person Inc., a wholly owned Sun subsidiary. <BR> <BR>In early 1993 the Green team heard about a Time-Warner request for proposal for a settop box <BR>operating system. First Person quickly shifted focus from smart consumer electronics (which was <BR>proving to be more hype than reality) to the set-top box OS market, and placed a bid with <BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -