版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、附錄AHistoryDuke, the Java mascotJames Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in June 1991. Java was originally designed for interactive television, but it was too advanced for the digital cable television industry at the time. The language was initially calle
2、d Oak after an oak tree that stood outside Gosling's office; it went by the name Green later, and was later renamed Java, from a list of random words.Gosling aimed to implement a virtual machine and a language that had a familiar C/C+ style of notation.Sun Microsystems released the first public
3、implementation as Java 1.0 in 1995. It promised "Write Once, Run Anywhere" (WORA, providing no-cost run-times on popular platforms. Fairly secure and featuring configurable security, it allowed network- and file-access restrictions. Major web browsers soon incorporated the ability to run J
4、ava applets within web pages, and Java quickly became popular. With the advent of Java 2 (released initially as J2SE 1.2 in December 19981999, new versions had multiple configurations built for different types of platforms. For example, J2EE targeted enterprise applications and the greatly stripped-
5、down version J2ME for mobile applications (Mobile Java. J2SE designated the Standard Edition. In 2006, for marketing purposes, Sun renamed new J2 versions as Java EE, Java ME, and Java SE, respectively.In 1997, Sun Microsystems approached the ISO/IEC JTC1 standards body and later the Ecma Internatio
6、nal to formalize Java, but it soon withdrew from the process. Java remains a de facto standard, controlled through the Java Community Process. At one time, Sun made most of its Java implementations available without charge, despite their proprietary software status. Sun generated revenue from Java t
7、hrough the selling of licenses for specialized products such as the Java Enterprise System. Sun distinguishes between its Software Development Kit (SDK and Runtime Environment (JRE (a subset of the SDK; the primary distinction involves the JRE's lack of the compiler, utility programs, and header
8、 files.On November 13, 2006, Sun released much of Java as open source software under the terms of the GNU General Public License (GPL. On May 8, 2007, Sun finished the process, making all of Java's core code available under free software/open-source distribution terms, aside from a small portion
9、 of code to which Sun did not hold the copyright.Sun's vice-president Rich Green has said that Sun's ideal role with regards to Java is as an "evangelist." Following Oracle Corporation's acquisition of Sun Microsystems in 20092010, Oracle has described itself as the "stewa
10、rd of Java technology with a relentless commitment to fostering a community of participation and transparency".PrinciplesThere were five primary goals in the creation of the Java language:1.It should be "simple, object oriented, and familiar"、2.It should be "robust and secure&quo
11、t;.3.It should be "architecture neutral and portable"、4.It should execute with "high performance"、5.It should be "interpreted, threaded, and dynamic".Java PlatformMain articles: Java (software platform and Java Virtual Machine One characteristic of Java is portability,
12、which means that computer programs written in the Java language must run similarly on any supported hardware/operating-system platform. This is achieved by compiling the Java language code to an intermediate representation called Java bytecode, instead of directly to platform-specific machine code.
13、Java bytecode instructions are analogous to machine code, but are intended to be interpreted by a virtual machine (VM written specifically for the host hardware. End-users commonly use a Java Runtime Environment (JRE installed on their own machine for standalone Java applications, or in a Web browse
14、r for Java applets. Standardized libraries provide a generic way to access host-specific features such as graphics, threading, and networking.A major benefit of using bytecode is porting. However, the overhead of interpretation means that interpreted programs almost always run more slowly than progr
15、ams compiled to native executables would. Just-in-Time compilers were introduced from an early stage that compile bytecodes to machine code during runtime.ImplementationsSun Microsystems officially licenses the Java Standard Edition platform for Linux, Mac OS X, and Solaris. Although in the past Sun
16、 has licensed Java to Microsoft, the license has expired and has not been renewed. Through a network of third-party vendors and licensees, alternative Java environments are available for these and other platforms.Sun's trademark license for usage of the Java brand insists that all implementation
17、s be "compatible". This resulted in a legal dispute with Microsoft after Sun claimed that the Microsoft implementation did not support RMI or JNI and had added platform-specific features of their own. Sun sued in 1997, and in 2001 won a settlement of US$20 million, as well as a court order
18、 enforcing the terms of the license from Sun. As a result, Microsoft no longer ships Java with Windows, and in recent versions of Windows, Internet Explorer cannot support Java applets without a third-party plugin. Sun, and others, have made available free Java run-time systems for those and other v
19、ersions of Windows.Platform-independent Java is essential to the Java EE strategy, and an even more rigorous validation is required to certify an implementation. This environment enables portable server-side applications, such as Web services, Java Servlets, and Enterprise JavaBeans, as well as with
20、 embedded systems based on OSGi, using Embedded Java environments. Through the new GlassFish project, Sun is working to create a fully functional, unified open source implementation of the Java EE technologies.Sun also distributes a superset of the JRE called the Java Development Kit (commonly known
21、 as theJDK, which includes development tools such as the Java compiler, Javadoc, Jar, and debugger.Java performance and garbage collectorsPrograms written in Java have a reputation for being slower and requiring more memory than those written in C. However, Java programs' execution speed improve
22、d significantly with the introduction of Just-in-time compilation in 1997/1998 for Java1.1, the addition of language features supporting better code analysis (such as inner classes, StringBuffer class, optional assertions, etc., and optimizations in the Java Virtual Machine itself, such as HotSpot b
23、ecoming the default for Sun's JVM in 2000. Currently, Java code has approximately half the performance of C code.Some platforms offer direct hardware support for Java; there are microcontrollers that can run java in hardware instead of a software JVM, and ARM based processors can have hardware s
24、upport for executing Java bytecode through its Jazelle option. Automatic memory managementJava uses an automatic garbage collector to manage memory in the object lifecycle. The programmer determines when objects are created, and the Java runtime is responsible for recovering the memory once objects
25、are no longer in use. Once no references to an object remain, the unreachable memory becomes eligible to be freed automatically by the garbage collector. Something similar to a memory leak may still occur if a programmer's code holds a reference to an object that is no longer needed, typically w
26、hen objects that are no longer needed are stored in containers that are still in use. If methods for a nonexistent object are called, a "null pointer exception" is thrown.One of the ideas behind Java's automatic memory management model is that programmers can be spared the burden of ha
27、ving to perform manual memory management. In some languages, memory for the creation of objects is implicitly allocated on the stack, or explicitly allocated and deallocated from the heap. In the latter case the responsibility of managing memory resides with the programmer. If the program does not d
28、eallocate an object, a memory leak occurs. If the program attempts to access or deallocate memory that has already been deallocated, the result is undefined and difficult to predict, and the program is likely to become unstable and/or crash. This can be partially remedied by the use of smart pointer
29、s, but these add overhead and complexity. Note that garbage collection does not prevent "logical" memory leaks, i.e. those where the memory is still referenced but never used.Garbage collection may happen at any time. Ideally, it will occur when a program is idle. It is guaranteed to be tr
30、iggered if there is insufficient free memory on the heap to allocate a new object; this can cause a program to stall momentarily. Explicit memory management is not possible in Java.Java does not support C/C+ style pointer arithmetic, where object addresses and unsigned integers (usually long integer
31、s can be used interchangeably. This allows the garbage collector to relocate referencedobjects and ensures type safety and security. As in C+ and some other object-oriented languages, variables of Java's primitive data types are not objects. Values of primitive types are either stored directly i
32、n fields (for objects or on the stack (for methods rather than on the heap, as commonly true for objects (but see Escape analysis. This was a conscious decision by Java's designers for performance reasons. Because of this, Java was not considered to be a pure object-oriented programming language
33、. However, as of Java 5.0, autoboxing enables programmers to proceed as if primitive types were instances of their wrapper class. Java contains multiple types of garbage collectors. By default, HotSpot uses the Concurrent Mark Sweep collector, also known as the CMS Garbage Collector. However, there
34、are also several other garbage collectors that can be used to manage the Heap. For 90% of applications in Java, the CMS Garbage Collector is good enough.A class that is not declared public may be stored in any .java file. The compiler will generate a class file for each class defined in the source f
35、ile. The name of the class file is the name of the class, with .class appended. For class file generation, anonymous classes are treated as if their name were the concatenation of the name of their enclosing class, a $, and an integer.The keyword public denotes that a method can be called from code
36、in other classes, or that a class may be used by classes outside the class hierarchy. The class hierarchy is related to the name of the directory in which the .java file is located.The keyword static in front of a method indicates a static method, which is associated only with the class and not with
37、 any specific instance of that class. Only static methods can be invoked without a reference to an object. Static methods cannot access any method variables that are not static.The keyword void indicates that the main method does not return any value to the caller. If a Java program is to exit with
38、an error code, it must call System.exit( explicitly.The method name "main" is not a keyword in the Java language. It is simply the name of the method the Java launcher calls to pass control to the program. Java classes that run in managed environments such as applets and Enterprise JavaBea
39、n do not use or need a main( method. A java program may contain multiple classes that have main methods, which means that the VM needs to be explicitly told which class to launch from.The main method must accept an array of String objects. By convention, it is referenced as args although any other l
40、egal identifier name can be used. Since Java 5, the main method can also use variable arguments, in the form of public static void main(String. args, allowing the main method to be invoked with an arbitrary number of String arguments. The effect of this alternate declaration is semantically identica
41、l (the args parameter is still an array of String objects, but allows an alternative syntax for creating and passing the array.The Java launcher launches Java by loading a given class (specified on the command line or as an attribute in a JAR and starting its public static void main(String method. S
42、tand-alone programs must declare this method explicitly. The String args parameter is an array of String objects containing any arguments passed to the class. The parameters to main are often passed by means of a command line.Criticism of JavaA number of criticisms have been leveled at Java programm
43、ing language for various design choices in the language and platform. Such criticisms include the implementation of generics, the handling of unsigned numbers, the implementation of floating-point arithmetic, and security vulnerabilities.Class librariesJava Platform and Class libraries diagramJava l
44、ibraries are the compiled bytecodes of source code developed by the JRE implementor to support application development in Java. Examples of these libraries are: The core libraries, which include:Collection libraries that implement data structures such as lists, dictionaries, trees, sets, queues and
45、double-ended queue, or stacksXML Processing (Parsing, Transforming, Validating librariesSecurityInternationalization and localization librariesThe integration libraries, which allow the application writer to communicate with external systems. These libraries include:The Java Database Connectivity (J
46、DBC API for database accessJava Naming and Directory Interface (JNDI for lookup and discoveryRMI and CORBA for distributed application developmentJMX for managing and monitoring applicationsUser interface libraries, which include:The (heavyweight, or native Abstract Window Toolkit (AWT, which provid
47、es GUI components, the means for laying out those components and the means for handling events from those componentsThe (lightweight Swing libraries, which are built on AWT but provide (non-native implementations of the AWT widgetryAPIs for audio capture, processing, and playbackA platform dependent
48、 implementation of Java Virtual Machine (JVM that is the means by which the byte codes of the Java libraries and third party applications are executedPlugins, which enable applets to be run in Web browsersJava Web Start, which allows Java applications to be efficiently distributed to end-users acros
49、s the InternetLicensing and documentation.DocumentationMain article: JavadocJavadoc is a comprehensive documentation system, created by Sun Microsystems, used by many Java developers. It provides developers with anorganized system for documenting their code. Javadoc comments have an extra asterisk a
50、t the beginning, i.e. the tags are /* and */, whereas the normal multi-line comment tags comments in Java and C are set off with /* and */.Sun has defined and supports four editions of Java targeting different application environments and segmented many of its APIs so that they belong to one of the
51、platforms. The platforms are:Java Card for smartcards.、Java Platform, Micro Edition(Java ME targeting environments with limited resources、Java Platform, Standard Edition (Java SE targeting workstation environments、Java Platform, Enterprise Edition (Java EE targeting large distributed enterprise or I
52、nternet environments. The classes in the Java APIs are organized into separate groups called packages. Each package contains a set of related interfaces, classes and exceptions. Refer to the separate platforms for a description of the packages available.The set of APIs is controlled by Sun Microsyst
53、ems in cooperation with others through the Java Community Process program. Companies or individuals participating in this process can influence the design and development of the APIs. This process has been a subject of controversy. Sun also provided an edition called PersonalJava that has been super
54、seded by later, standards-based Java ME configuration-profile pairings.JSP ProfileJSP (JavaServer Pages is initiated by Sun Microsystems, Inc., with many companies to participate in the establishment of a dynamic web page technical standards. JSP technology somewhat similar to ASP technology, it is
55、in the traditional HTML web page document (*. htm, *. html to insert the Java programming paragraph (Scriptlet and JSP tag (tag, thus JSP documents (*. jsp. Using JSP development of the Web application is cross-platform that can run on Linux, is also available for other operating systems.JSP technol
56、ogy to use the Java programming language prepared by the category of XML tags and scriptlets, to produce dynamic pages package processing logic. Page also visit by tags and scriptlets exist in the services side of the resources of logic. JSP page logic and web page design and display separation, sup
57、port reusable component-based design, Web-based application development is rapid and easy.Web server in the face of visits JSP page request, the first implementation of the procedures of, and then together with the results of the implementation of JSP documents in HTML code with the return to the cu
58、stomer. Insert the Java programming operation of the database can be re-oriented websites, in order to achieve the establishment of dynamic pages needed to function.JSP and Java Servlet, is in the implementation of the server, usually returned to the client is an HTML text, as long as the client bro
59、wser will be able to visit.JSP 1.0 specification of the final version is launched in September 1999, December has introduced 1.1 specifications. At present relatively new is JSP1.2 norms, JSP2.0 norms of the draft has also been introduced.JSP pages from HTML code and Java code embedded in one of the
60、 components.The server was in the pages of client requests after the Java code and then will generate the HTML pages to return to the client browser. Java Servlet JSP is the technical foundation and large-scale Web application development needs of Java Servlet and JSP support to complete. JSP with the Java technology easy to use, fully ob
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024秋八年級(jí)數(shù)學(xué)上冊(cè) 第14章 勾股定理14.1 勾股定理 2直角三角形三邊的關(guān)系-驗(yàn)證勾股定理教案(新版)華東師大版
- 2023七年級(jí)數(shù)學(xué)下冊(cè) 第8章 一元一次方程8.3 一元一次不等式組第2課時(shí)解一元一次不等式組(2)教案 (新版)華東師大版
- 2024加工承攬合同的標(biāo)的及合同屬性分析
- 2024年土地使用權(quán)轉(zhuǎn)讓合同:甲方轉(zhuǎn)讓土地使用權(quán)給乙方
- 2024年學(xué)校與家長(zhǎng)教育質(zhì)量共保協(xié)議
- 2024年寵物用品批量采購(gòu)與供貨合同
- 2024年修訂版:數(shù)據(jù)中心設(shè)備維修服務(wù)合同
- 2024年丙丁雙方關(guān)于環(huán)保技術(shù)研發(fā)的許可合同
- 2024年市場(chǎng)營(yíng)銷活動(dòng)臨時(shí)工協(xié)議
- 2024年工程勞務(wù)外包合同范本
- 大班數(shù)學(xué)《貪心的三角形》課件
- 金屬和半導(dǎo)體材料電導(dǎo)(材料物理性能)
- 最新八年級(jí)道法上冊(cè)概括與評(píng)論題角度匯編
- 新噸公里計(jì)算
- 某熱力管道工程施工組織設(shè)計(jì)方案
- 重慶12.23特大井噴案例
- 外墻面磚脫落維修施工方案完整
- 煤場(chǎng)機(jī)械車輛操作規(guī)程
- 圍手術(shù)期重癥監(jiān)護(hù)
- 西南油氣田對(duì)外合作項(xiàng)目基于PSC談判經(jīng)濟(jì)評(píng)價(jià)
- 6_背景調(diào)查表
評(píng)論
0/150
提交評(píng)論