java基础功能介绍外文翻译(共9页).doc

上传人:飞****2 文档编号:19340622 上传时间:2022-06-06 格式:DOC 页数:9 大小:50KB
返回 下载 相关 举报
java基础功能介绍外文翻译(共9页).doc_第1页
第1页 / 共9页
java基础功能介绍外文翻译(共9页).doc_第2页
第2页 / 共9页
点击查看更多>>
资源描述

《java基础功能介绍外文翻译(共9页).doc》由会员分享,可在线阅读,更多相关《java基础功能介绍外文翻译(共9页).doc(9页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、精选优质文档-倾情为你奉上外文原文Java FundamentalsThe rise of the Internet and the World Wide Web have fundamentally reshaped computing. Only a few short years ago, the cyber landscape was dominated by stand-alone PCs. Today, nearly all PCs are connected to the Internet. The Internet, itself, was transformedorigina

2、lly offering a convenient way to share files and information, today it is a vast, distributed computing universe. These changes have been as rapid as they have been profound, and in their wake, they gave rise to a new way to program: Java. Java is the preeminent language of the Internet, but it is m

3、ore than that. Java has revolutionized programming, changing the way that we think about both the form and the function of a program. To be a professional programmer today implies the ability to program in Javait has become that important. In the course of this book, you will learn the skills needed

4、 to master it. The purpose of this module is to introduce you to Java, including its history, its design philosophy, and several of its most important features. By far, the hardest thing about learning a programming language is the fact that no element exists in isolation. Instead, the components of

5、 the language work in conjunction with each other. This interrelatedness is especially pronounced in Java. In fact, it is difficult to discuss one aspect of Java without involving others. To help overcome this problem, this module provides a brief overview of several Java features, including the gen

6、eral form of a Java program, some basic control structures, and operators. It does not go into too many details but, rather, concentrates on the general concepts common to any Java program.1.1 The Origins of JavaComputer language innovation is driven forward by two factors: improvements in the art o

7、f programming and changes in the computing environment. Java is no exception. Building upon the rich legacy inherited from C and C+, Java adds refinements and features that reflect the current state of the art in programming. Responding to the rise of the online environment, Java offers features tha

8、t streamline programming for a highly distributed architecture.Java was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike Sheridan at Sun Microsystems in 1991. This language was initially called “Oak” but was renamed “Java” in 1995. Somewhat surprisingly, the original imp

9、etus for Java was not the Internet! Instead, the primary motivation was the need for a platform-independent language that could be used to create software to be embedded in various consumer electronic devices, such as toasters, microwave ovens, and remote controls. As you can probably guess, many di

10、fferent types of CPUs are used as controllers. The trouble was that most computer languages are designed to be compiled for a specific target. For example, consider C+. Although it is possible to compile a C+ program for just about any type of CPU, to do so requires a full C+ compiler targeted for t

11、hat CPU. The problem, however, is that compilers are expensive and time-consuming to create. In an attempt to find a better solution, Gosling Java Fundamentals and others worked on a portable, cross-platform language that could produce code that would run on a variety of CPUs under differing environ

12、ments. This effort ultimately led to the creation of Java.About the time that the details of Java were being worked out, a second, and ultimately more important, factor emerged that would play a crucial role in the future of Java. This second force was, of course, the World Wide Web. Had the Web not

13、 taken shape at about the same time that Java was being implemented, Java might have remained a useful but obscure language for programming consumer electronics. However, with the emergence of the Web, Java was propelled to the forefront of computer language design, because the Web, too, demanded po

14、rtable programs.Most programmers learn early in their careers that portable programs are as elusive as they are desirable. While the quest for a way to create efficient, portable (platform-independent) programs is nearly as old as the discipline of programming itself, it had taken a back seat to oth

15、er, more pressing problems. However, with the advent of the Internet and the Web, the old problem of portability returned with a vengeance. After all, the Internet consists of a diverse, distributed universe populated with many types of computers, operating systems, and CPUs.What was once an irritat

16、ing but a low-priority problem had become a high-profile necessity.By 1993 it became obvious to members of the Java design team that the problems of portability frequently encountered when creating code for embedded controllers are also found when attempting to create code for the Internet. This rea

17、lization caused the focus of Java to switch from consumer electronics to Internet programming. So, while it was the desire for an architecture-neutral programming language that provided the initial spark, it was the Internet that ultimately led to Javas large-scale success.How Java Relates to C and

18、C+Java is directly related to both C and C+. Java inherits its syntax from C. Its object model is adapted from C+. Javas relationship with C and C+ is important for several reasons. First, many programmers are familiar with the C/C+ syntax. This makes it easy for a C/C+ programmer to learn Java and,

19、 conversely, for a Java programmer to learn C/C+. Second, Javas designers did not “reinvent the wheel.” Instead, they further refined an already highly successful programming paradigm. The modern age of programming began with C. It moved to C+, and now to Java. By inheriting and building upon that r

20、ich heritage, Java provides a powerful, logically consistent programming environment that takes the best of the past and adds new features required by the online environment. Perhaps most important, because of their similarities, C, C+, and Java define a common, conceptual framework for the professi

21、onal programmer. Programmers do not face major rifts when switching from one language to another. One of the central design philosophies of both C and C+ is that the programmer is in charge! Java also inherits this philosophy. Except for those constraints imposed by the Internet environment, Java gi

22、ves you, the programmer, full control. If you program well, your programs reflect it. If you program poorly, your programs reflect that, too. Put differently, Java is not a language with training wheels. It is a language for professional programmers. Java has one other attribute in common with C and

23、 C+: it was designed, tested, and refined by real, working programmers. It is a language grounded in the needs and experiences of the people who devised it. There is no better way to produce a top-flight professional programming language.Because of the similarities between Java and C+, especially th

24、eir support for objectoriented programming, it is tempting to think of Java as simply the “Internet version of C+.” However, to do so would be a mistake. Java has significant practical and philosophical differences. Although Java was influenced by C+, it is not an enhanced version of C+. For example

25、, it is neither upwardly nor downwardly compatible with C+. Of course, the similarities with C+ are significant, and if you are a C+ programmer, you will feel right at home with Java. Another point: Java was not designed to replace C+. Java was designed to solve a certain set of problems. C+ was des

26、igned to solve a different set of problems. Both will coexist for many years to come.How Java Relates to C#Recently a new language called C# has come on the scene. Created by Microsoft to support its .NET Framework, C# is closely reated to Java. In fact, many of C#s features were directly adapted fr

27、om Java. Both Java and C# share the same general C+-style syntax, support distributed programming, and utilize the same object model. There are, of course, differences between Java and C#, but the overall “look and feel” of these languages is very similar. This means that if you already know C#, the

28、n learning Java will be especially easy. Conversely, if C# is in your future, then your knowledge of Java will come in handy. Given the similarity between Java and C#, one might naturally ask, “Will C# replace Java?” The answer is No. Java and C# are optimized for two different types of computing en

29、vironments. Just as C+ and Java will co-exist for a long time to come, so will C# and Java.1.2 Javas Contribution to the InternetThe Internet helped catapult Java to the forefront of programming, and Java, in turn, has had a profound effect on the Internet. The reason for this is quite simple: Java

30、expands the universe of objects that can move about freely in cyberspace. In a network, there are two very broad categories of objects that are transmitted between the server and your personal computer: passive information and dynamic, active programs. For example, when you read your e-mail, you are

31、 viewing passive data. Even when you download a program, the programs code is still only passive data until you execute it. However, a second type of object can be transmitted to your computer: a dynamic, self-executing program. Such a program is an active agent on the client computer, yet it is ini

32、tiated by the server. For example, a program might be provided by the server to properly display the data that it is sending. As desirable as dynamic, networked programs are, they also present serious problems in the areas of security and portability. Prior to Java, cyberspace was effectively closed

33、 to half of the entities that now live there. As you will see, Java addresses those concerns and, in doing so, has defined a new form of program: the applet.Java Applets and ApplicationsJava can be used to create two types of programs: applications and applets. An application is a program that runs

34、on your computer, under the operating system of that computer. An application created by Java is more or less like one created using any other type of computer language, such as Visual Basic or C+. When used to create applications, Java is not much different from any other computer language. Rather,

35、 it is Javas ability to create applets that makes it important. An applet is an application designed to be transmitted over the Internet and executed by a Java-compatible Web browser. Although any computer language can be used to create an application, only Java can be used to create an applet. The

36、reason is that Java solves two of the thorniest problems associated with applets: security and portability. Before continuing, lets define what these two terms mean relative to the Internet.SecurityAs you are almost certainly aware, every time you download a “normal” program, you are risking a viral

37、 infection. Prior to Java, most users did not download executable programs frequently, and those that did, scanned them for viruses prior to execution. Even so, most users still worried about the possibility of infecting their systems with a virus or allowing a malicious program to run wild in their

38、 systems. (A malicious program might gather private information, such as credit card numbers, bank account balances, and passwords by searching the contents of your computers local file system.) Java answers these concerns by providing a firewall between a networked application and your computer.Whe

39、n using a Java-compatible web browser, it is possible to safely download Java applets without fear of viral infection. The way that Java achieves this is by confining a Java program to the Java execution environment and not allowing it access to other parts of the computer. (You will see how this is

40、 accomplished, shortly.) Frankly, the ability to download applets with confidence that no harm will be done to the client computer is the single most important aspect of Java.PortabilityAs discussed earlier, many types of computers and operating systems are connected to the Internet. For programs to

41、 be dynamically downloaded to all of the various types of platforms, some means of generating portable executable code is needed. As you will soon see, the same mechanism that helps ensure security also helps create portability. Indeed, Javas solution to these two problems is both elegant and effici

42、ent.外文翻译JAVA的基础互联网和万维网的崛起已经从根本上重塑了计算。仅短短几年前,网络景观的主导力量还是独立的个人电脑。而今天,几乎所有的电脑都连接到互联网。互联网本身也得到转化,原本提供一个方便的途径来共享文件和信息,而今天它是一个巨大的,分布式计算宇宙。因特网就像它本身的深度一样迅速的变化,因为在因特网之后,产生了一种新的语言进行编程:Java语言。Java是互联网的杰出的语言,但它不止于此。 Java具有革命性编程,改变了我们思考程序形式和功能的方式。今天要成为一名专业程序员今日意味着在Java的能力,它已成为这一重要计划。在这本书的过程中,你将学习掌握它需要的技能。本单元目的是向

43、你介绍Java中,包括它的历史,其设计理念,其最重要的特征数。到目前为止,有关学习一种编程语言最难的事情是没有孤立存在的元素。相反,语言的组成部分之间相互关联。这在Java语言中尤为特别。事实上,很难讨论Java的一个方面而不卷入Java的另外一些方面。为了帮助解决这个问题,这个模块提供了一些Java特性,包括一个Java程序的一般形式简要概述,一些基本的控制结构和运算符。它不会进入太多的细节,而是集中在任何Java程序都会有的一些共性。1.1 Java的起源 计算机语言创新是由两个因素驱动着:在编程艺术的改进和计算环境的改变。 Java也没有例外。Java从C和C+继承传统的基础之上增加了丰

44、富的改进和功能,反映在编程的艺术现状。为了响应在线环境的增长,Java提供了高度分布式架构的流线编程。Java是1991年由James Gosling,Patrick Naughton,Chris Warth,Ed Frank 和 Mike Sheridan在Sun公司构想出来的。这种语言最初被称为“Oak”,但在1995年改名为“Java”。奇怪的是,构思Java的原始动力竟然不是互联网,相反,在主要的动机是一个平台无关的语言,可用于创建需要在各种消费电子设备的嵌入式程序例如烤面包机,微波炉,远程控制。正如你可能猜到,许多不同类型的CPU都被作为控制器。麻烦的是,大多数计算机语言的目的是为特

45、定目标的编制。例如,C+就是。虽然可以编译一个C+程序的几乎所有类型的CPU,但是这样需要一个完整的C+编译器来对应这个CPU。但问题是,创建编译器昂贵而且费时。James Gosling在试图找到更好的解决办法,他和他的同事们致力于一种便携的,跨平台的语言,它能产生在不同环境的cpu下都能运行的代码。这一努力最终导致了Java的产生。正当Java的细节正在拟定的时候,第二个因素,并最终显得更重要的因素出现,并在在Java的未来中起着重要的角色作用。这第二个推动力量当然是万维网了。如果该网页没有和Java在同一时间出现并崭露头角,Java虽然仍然会是有用的编程语言但是不会作为为消费电子编程的语

46、言而著名。然而,随着互联网的出现,Java推动对计算机语言设计的前沿,因为Web的出现,也要求便携的编程方式。大多数程序员在其职业生涯早期的学习中知道可移植程序是多么难以实现,因为它们是理想的。虽然寻求创造高效,可移植(平台无关)程序的方式几乎和编程它自己一样古老了,但是这必须解决诸多问题。然而,随着互联网和Web的发展,老问题的出现就像是报复一样。毕竟,互联网由一个多样化的,分布式的计算机宇宙,包含了各种各样的电脑,操作系统和CPU.曾经非常棘手的问题现在不得不成为一个必须解决的问题了。到了1993年,在可移植过程中经常遇到的问题,对于Java的可移植性设计团队成员已经能解决了。当创造的嵌入

47、式控制器的代码的同时,也在试图创建互联网的代码。这一点认识把Java的重点从消费类电子的嵌入式开关过渡到互联网编程了。因此,尽管Java设计为结构中立的编程语言,提供最初的火花,但是这是最终导致Java在因特网大规模成功的原因。Java与c和c+有何关联Java是直接关系到C和C + +。 Java的继承了它从C语法的对象模型是从C + +改写。 Java的C和C + +的关系是很重要的几个原因。第一,许多程序员用C / C + +语法熟悉。这就需要一个C / C + +程序员容易学习Java,相反,为Java程序员学习C / C + +的。其次,Java的设计者并没有“另起炉灶。”相反,他们

48、进一步完善了已经非常成功的编程范例。当今时代的节目开始C.它移动到C + +,现在到Java。通过继承遗产,并呼吁富有建设,Java提供了一个强大的,在逻辑上一致的编程环境,把过去的最好的,并增加了在线环境所需的新功能。也许最重要的,因为他们的相似性定义,C语言,C + +和Java的一个共同的,为专业程序员的概念框架。程序员不从一种语言时所面临的切换到另一个重大分歧。对C和C + +的核心设计理念之一是,程序员要负责! Java也继承这一理念。除通过互联网环境施加的限制,让你的Java,程序员,完全控制。如果你的方案好,它反映了你的方案。如果方案不好,您的程序反映这一点。把不同的,Java是

49、不是一个轮子的语言培训。这是一个专业的程序员的语言。Java有一个共同的C和C + +其他属性:它是设计,测试,以及真实的,精致的程序员工作。它是在需要和人民谁发明它的经验为基础的语言。有没有更好的方法来生产一流的专业的编程语言。由于Java与C + +的相似之处,特别是他们对面向对象编程支持,这是很有诱惑力的爪哇看成简单的“C + +的网络版。”然而,这样做将是一个错误。 Java具有重大现实和哲学的差异。虽然Java是由C + +的影响,它不是一个对C + +的增强版。例如,它既不向上也不向下兼容的C + +。当然,用C + +的相似性是重要的,如果你是一个C + +程序员,你会觉得在权利与Java的家。另外一点:Java是不是要取代C + +。 Java的目的是要解决的问题的某些设置。 C + +的目的是为了解决不同的问题。两者将共存多年来。Java与c#有何关联最近,一个新的语言称为C对现场来。微软支持其创建的。NET框架,C是Java的紧密reated。事

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 教案示例

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁