1、外文原文 Introduction to Java autor: Martin Ngobye. source: Computing Static Slice for Java Programs Java is designed to meet the challenges of application development in the context of heterogeneous, network-wide distributed environments. Paramount among these challenges is secure delivery of applicati
2、ons that consume the minimum of system resources, can run on any hardware and software platform, and can be extended dynamically. Java originated as part of a research project to develop advanced software for a wide variety of network devices and embedded systems. The goal was to develop a small, re
3、liable, portable, distributed, real-time operating platform. When the project started, C+ was the language of choice. But over time the difficulties encountered with C+ grew to the point where the problems could best be addressed by creating an entirely new language platform. Design and architecture
4、 decisions drew from a variety of languages such as Eiffel, SmallTalk, Objective C, and Cedar/Mesa. The result is a language platform that has proven ideal for developing secure, distributed, network based end-user applications in environments ranging from network-embedded devices to the World-Wide
5、Web and the desktop. The design requirements of Java are driven by the nature of the computing environments in which software must be deployed. The massive growth of the Internet and the World-Wide Web leads us to a completely new way of looking at development and distribution of software. To live i
6、n the world of electronic commerce and distribution, Java must enable the development of secure, high performance, and highly robust applications on multiple platforms in heterogeneous, distributed networks. Operating on multiple platforms in heterogeneous networks invalidates the traditional scheme
7、s of binary distribution, release, upgrade, patch, and so on. To survive in this jungle, Java must be architecture neutral, portable, and dynamically adaptable. The Java system that emerged to meet these needs is simple, so it can be easily programmed by most developers; familiar, so that current de
8、velopers can easily learn Java; object oriented, to take advantage of modern software development methodologies and to fit into distributed client-server applications; multithreaded, for high performance in applications that need to perform multiple concurrent activities, such as multimedia; and int
9、erpreted, for maximum portability and dynamic capabilities. Together, the above requirements comprise quite a collection of buzzwords, so lets examine some of them and their respective benefits before going on. Whats completely new is the manner in which Java and its run-time system have combined th
10、em to produce a flexible and powerful programming system. Developing your applications using Java results in software that is portable across multiple machine architectures, operating systems, and graphical user interfaces, secure, and high performance, With Java, your job as a software developer is
11、 much easier you focus your full attention on the end goal of shipping innovative products on time, based on the solid foundation of Java. The better way to develop software is here, now, brought to you by the Java language platform. Very dynamic languages like Lisp, TCL, and SmallTalk are often use
12、d for prototyping. One of the reasons for their success at this is that they are very robust you dont have to worry about freeing or corrupting memory. Similarly, programmers can be relatively fearless about dealing with memory when programming in Java, The garbage collection system makes the progra
13、mmers job vastly easier; with the burden of memory management taken off the programmers shoulders, storage allocation errors go away. Another reason commonly given that languages like Lisp, TCL, and SmallTalk are good for prototyping is that they dont require you to pin down decisions early on these
14、 languages are semantically rich. Java has exactly the opposite property: it forces you to make explicit choices. Along with these choices come a lot of assistance you can write method invocations and, if you get something wrong, you get told about it at compile time. You dont have to worry about me
15、thod invocation error. The Java beginner must grasp 30 basic concepts Basic concept 1.In OOP the only relations is what the object s interface, such as the computer seller he leaves alone internal structure of electrical source, but he is only concerned about that whether the power will be supplied
16、to you, also so long as know can or not but is not how and why.All procedures are make up of certain attribute and the behavior object, the different object visit invokes through the function invocation, between the object all intercommunion are invoke through the method invocation, By object data e
17、ncapsulation, enhances reuse rate very much. 2.In OOP the most important thought is class, the class is the template ,is a blueprint, construct an object from a class, namely construct an instance of the class. 3. Encapsulation: is that combines the data and the behavior in a package) and hides the
18、data the realization process to the object user, in an object data is called its instance field. 4.Through expands a class to obtain a new class is called inheritance, but all classes are constructed by the object super root class of expansion, super root class of as follows can make the introductio
19、n. 5.Object 3 principal characteristics Behavior- explained this object can make what. Tate- when the object exerts the method object reflection. Dentity- and other similar behavior objects discrimination symbols. Each object has only indentity and among three characteristics they affect mutually. 6
20、. Relations among classes: Use-a:Dependent relation Has-a:Polymerization relation Is-a: inheritor relation - example:A class has inherited B class, this time A class not only has B class of method, but also has its own method(Individuality exists in general character) 7.Structure object use structur
21、e:Structure proposing, the structure is one special method, the structure object and to its initialization. Example:A Data class of structure calls Data New Data () - structure a new object, also initialize current time. Data happyday=new Data () - an object evaluates an variable happyday, thus enab
22、les this object to be used many times, here be stated the cause variable and the object variable are different. New returns the value is a quotation. Constructor characteristic:The constructor may have 0, one or many parameters The constructor and the class have the same name A class may have many c
23、onstructor. The constructor has not returned value The constructor always be together used with the new operator 8. Over loading: When many methods have the same name when includes the different parameter, then has the over loading Which method does the compiler have to choose invokes. 9.Package : J
24、ava allow one or many classes to become together as group, is called package, to organizing duty easily, the standard Java storehouse divides into many packages Java.Lang java.Util java, net and so on, the package is layered and all java packages are in java and in a javax package. 10. Extendable thought: permit to construct new class on existing classes , when you extend the class which already existed, then you reuse this class of method and the field,