当前位置:文档之家› JAVA的基础外文翻译

JAVA的基础外文翻译

JAVA的基础外文翻译
JAVA的基础外文翻译

外文原文

Java Fundamentals

The 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 transformed—originally 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 more 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 Java—it has become that important. In the course of this book, you will learn the skills needed 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 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 general 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 Java

Computer language innovation is driven forward by two factors: improvements in the art of 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 that 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 in itially called “Oak” but was renamed “Java” in 1995. Somewhat surprisingly, the original impetus 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 different 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 that 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 environments. 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 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 portable 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 other, 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 irritating 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 realization 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 Java’s large-scale success.

How Java Relates to C and C++

Java is directly related to both C and C++. Java inherits its syntax from C. Its object model is adapted from C++. Java’s 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, conversely, for a Java programmer to learn C/C++.

Second, Java’s 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 rich 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 professional 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 gives 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 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 their 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, 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 designed 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 from 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#, then 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 environments.

Just as C++ and Java will co-exist for a long time to come, so will C# and Java.

1.2 Java’s Contribution to the Internet

The 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 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 viewing passive data. Even when you download a program, the program’s 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 initiated 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 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 Applications

Java can be used to create two types of programs: applications and applets. An application is a program that runs 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 langua ge. Rather, it is Java’s 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 reason is that Java solves two of the thorniest problems associated with applets: security and portability. Before continuing, let’s define what these two terms mean relative to the Internet.

Security

As you are almost certainly aware, every time you download a “normal” program, you are risking a viral 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 systems. (A malicious program might gather private information, such as credit card numbers, bank account balances, and passwords by searching the contents of your computer’s local file system.) Java answers these concerns by providing

a firewall between a networked application and your computer.

When 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 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.

Portability

As discussed earlier, many types of computers and operating systems are connected to the Internet. For programs to 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, Java’s solution to these two problems is both elegant and efficient.

外文翻译

JAVA的基础

互联网和万维网的崛起已经从根本上重塑了计算。仅短短几年前,网络景观的主导力量还是独立的个人电脑。而今天,几乎所有的电脑都连接到互联网。互联网本身也得到转化,原本提供一个方便的途径来共享文件和信息,而今天它是一个巨大的,分布式计算宇宙。因特网就像它本身的深度一样迅速的变化,因为在因特网之后,产生了一种新的语言进行编程:Java语言。

Java是互联网的杰出的语言,但它不止于此。 Java具有革命性编程,改变了我们思考程序形式和功能的方式。今天要成为一名专业程序员今日意味着在Java的能力,它已成为这一重要计划。在这本书的过程中,你将学习掌握它需要的技能。

本单元目的是向你介绍Java中,包括它的历史,其设计理念,其最重要的特征数。到目前为止,有关学习一种编程语言最难的事情是没有孤立存在的元素。相反,语言的组成部分之间相互关联。这在Java语言中尤为特别。事实上,很难讨论Java的一个方面而不卷入Java的另外一些方面。为了帮助解决这个问题,这个模块提供了一些Java特性,包括一个Java程序的一般形式简要概述,一些基本的控制结构和运算符。它不会进入太多的细节,而是集中在任何Java程序都会有的一些共性。

1.1 Java的起源

计算机语言创新是由两个因素驱动着:在编程艺术的改进和计算环境的改变。 Java 也没有例外。Java从C和C++继承传统的基础之上增加了丰富的改进和功能,反映在编程的艺术现状。为了响应在线环境的增长,Java提供了高度分布式架构的流线编程。

Java是1991年由James Gosling,Patrick Naughton,Chris Warth,Ed Frank 和 Mike Sheridan在Sun公司构想出来的。这种语言最初被称为“Oak”,但在1995年改名为“Java”。奇怪的是,构思Java的原始动力竟然不是互联网,相反,在主要的动机是一个平台无关的语言,可用于创建需要在各种消费电子设备的嵌入式程序例如烤面包机,微波炉,远程控制。正如你可能猜到,许多不同类型的CPU都被作为控制器。麻烦的是,大多数计算机语言的目的是为特定目标的编制。例如,C++就是。

虽然可以编译一个C++程序的几乎所有类型的CPU,但是这样需要一个完整的C++编译器来对应这个CPU。但问题是,创建编译器昂贵而且费时。James Gosling在试图找到更好的解决办法,他和他的同事们致力于一种便携的,跨平台的语言,它能产生在不同环境的cpu下都能运行的代码。这一努力最终导致了Java的产生。

正当Java的细节正在拟定的时候,第二个因素,并最终显得更重要的因素出现,并在在Java的未来中起着重要的角色作用。这第二个推动力量当然是万维网了。如果该网页没有和Java在同一时间出现并崭露头角,Java虽然仍然会是有用的编程语言但是不会

作为为消费电子编程的语言而著名。然而,随着互联网的出现,Java推动对计算机语言设计的前沿,因为Web的出现,也要求便携的编程方式。

大多数程序员在其职业生涯早期的学习中知道可移植程序是多么难以实现,因为它们是理想的。虽然寻求创造高效,可移植(平台无关)程序的方式几乎和编程它自己一样古老了,但是这必须解决诸多问题。然而,随着互联网和Web的发展,老问题的出现就像是报复一样。毕竟,互联网由一个多样化的,分布式的计算机宇宙,包含了各种各样的电脑,操作系统和CPU.曾经非常棘手的问题现在不得不成为一个必须解决的问题了。

到了1993年,在可移植过程中经常遇到的问题,对于Java的可移植性设计团队成员已经能解决了。当创造的嵌入式控制器的代码的同时,也在试图创建互联网的代码。这一点认识把Java的重点从消费类电子的嵌入式开关过渡到互联网编程了。因此,尽管Java设计为结构中立的编程语言,提供最初的火花,但是这是最终导致Java在因特网大规模成功的原因。

Java与c和c++有何关联

Java是直接关系到C和C + +。 Java的继承了它从C语法的对象模型是从C + +改写。Java的C和C + +的关系是很重要的几个原因。第一,许多程序员用C / C + +语法熟悉。这就需要一个C / C + +程序员容易学习Java,相反,为Java程序员学习C / C + +的。

其次,Java的设计者并没有“另起炉灶。”相反,他们进一步完善了已经非常成功的编程范例。当今时代的节目开始C.它移动到C + +,现在到Java。通过继承遗产,并呼吁富有建设,Java提供了一个强大的,在逻辑上一致的编程环境,把过去的最好的,并增加了在线环境所需的新功能。也许最重要的,因为他们的相似性定义,C语言,C + +和Java的一个共同的,为专业程序员的概念框架。程序员不从一种语言时所面临的切换到另一个重大分歧。

对C和C + +的核心设计理念之一是,程序员要负责! Java也继承这一理念。除通过互联网环境施加的限制,让你的Java,程序员,完全控制。如果你的方案好,它反映了你的方案。如果方案不好,您的程序反映这一点。把不同的,Java是不是一个轮子的语言培训。这是一个专业的程序员的语言。

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#的许多功能是直接改编自爪哇。 Java和C#都共享相同的一般的C + +风格的语法,支持分布式程序设计,并使用相同的对象模型。当然有,Java 和C之间的差异#,但总的“外观和感觉这些语言的”非常相似。这意味着,如果你已经知道C#,那么学习Java将特别容易。反之,如果C#是你的未来,那么你的Java知识能派上用场。由于在Java和C#相似,人们可能会自然地问:“请问C#中取代Java吗?”答案是Java和C#号是两个不同类型的计算环境优化。正如C + +和Java将合作很长一段时间来存在,因此将C#和Java。

1.2 Java对因特网的贡献

互联网帮助弹射Java来的节目的前列,和Java,反过来,已在互联网上产生深远的影响。其原因是相当简单:扩大了的Java对象,可以在网络空间中自由走动宇宙的原因。在网络中,有两个非常广泛的是在服务器之间和个人电脑:被动的信息和动态,积极传播节目的各类文物。例如,当你读你的电子邮件,您正在查看的被动数据。即使当您下载一个程序,该程序的代码还只是被动的数据,直到你执行它。然而,第二种类型的对象可以传输到您的计算机:一个动态的,自动执行程序。这种方案是在客户端计算机活性剂,但它是由服务器发起的。例如,一个程序可能是由服务器提供正确显示数据,这是发送。

作为理想的,动态的,联网方案,他们也出席在安全性和便携性方面的严重问题。在此之前,到Java,网络空间得到了有效封闭的实体,现在生活在那里的一半。正如你将看到,Java的解决这些问题,并在这样做,已经确定了新形式的节目:小程序。

Java小程序和应用

Java可以被用于创建两种类型的程序:应用程序和applet。应用程序是一种程序,在您的计算机运行在该计算机的操作系统。 Java是由或多或少像一个创建使用如Visual Basic或C + +计算机语言的任何其他类型的应用软件。当用于创建应用程序,Java没有太大的任何其他计算机语言不同。相反,它是Java的创造能力,使小程序很重要。一个applet是一种应用程序设计为在互联网上传输和Java的兼容的Web浏览器执行。虽然任何计算机语言可以用来创建应用程序,只有Java可以被用于创建一个applet。原因是,Java的小程序解决了两个与有关的最棘手的问题:安全性和可移植性。在继续之前,让我们定义这两个词是什么意思相对于互联网。

安全

如你几乎可以肯定知道,每一次你下载一个“正常”的计划,你是冒着一种病毒感染。在此之前爪哇,大多数用户没有下载可执行程序频繁,那些没有,他们进行了病毒

扫描之前执行。即便如此,大多数用户仍然担心的是感染了病毒或恶意程序,允许在其系统中运行他们的系统野生的可能性。(恶意程序可能会收集私人信息,如信用卡号码,银行账户余额和密码通过搜索您的计算机的本地文件系统的内容。)渣的答案提供了一个网络应用程序之间和你的电脑防火墙这些问题。

当使用一个Java兼容的网络浏览器,它可以安全地下载不担心感染病毒的Java小程序。爪哇的方式实现这一禁锢Java程序的Java执行环境,不允许它访问计算机的其他部分。(你会看到这是如何完成,不久)。坦率地说,能够下载满怀信心地说,这样做会不会伤害到客户端计算机小程序是一个最重要的Java方面。

可移植性

在之前的讨论中提到过,许多类型的计算机和操作系统连接到互联网。程序被动态的下载到多种多样的平台,因此生成可移植的执行代码是必要的。正如您将很快看到的,同样的机制,有助于确保安全也有利于创造可移植性。事实上,Java解决这两个问题的方式,既优雅又高效。

外文翻译java

外文资料译文及原文 Java Java I/O 系统 对编程语言的设计者来说,创建一套好的输入输出(I/O)系统,是一项难度极高的任务。 这一点可以从解决方案的数量之多上看出端倪。这个问题难就难在它要面对的可能性太多了。不仅是因为有那么多I/O的源和目地(文件,控制台,网络连接等等),而且还有很多方法(顺序的『sequential』,随机的『random-access』,缓存的『buffered』,二进制的『binary』,字符方式的『character』,行的『by lines』,字的『by words』,等等)。 Java类库的设计者们用"创建很多类"的办法来解决这个问题。坦率地说Java I/O系统的类实在是太多了,以至于初看起来会把人吓着(但是,具有讽刺意味的是,这种设计实际上是限制了类的爆炸性增长)。此外,Java在1.0版之后又对其I/O类库作了重大的修改,原先是面向byte的,现在又补充了面向Unicode字符的类库。为了提高性能,完善功能,JDK 1.4又加了一个nio(意思是"new I/O"。这个名字会用上很多年)。这么以来,如果你想对Java的I/O 类库有个全面了解,并且做到运用自如,你就得先学习大量的类。此外,了解 I/O类库的演化的历史也是相当重要的。可能你的第一反应是"别拿什么历史来烦我了,告诉我怎么用就可以了!"但问题是,如果你对这段历史一无所知,很快就会被一些有用或是没用的类给搞糊涂了。

本章会介绍Java标准类库中的各种I/O类,及其使用方法。 File 类 在介绍直接从流里读写数据的类之前,我们先介绍一下处理文件和目录的类。 File类有一个极具欺骗性的名字;或许你会认为这是一个关于文件的类,但它不是。你可以用它来表示某个文件的名字,也可以用它来表示目录里一组文件的名字。如果它表示的是一组文件,那么你还可以用list( )方法来进行查询,让它会返回String数组。由于元素数量是固定的,因此数组会比容器更好一些。如果你想要获取另一个目录的清单,再建一个File对象就是了。实际上,叫它"FilePath"可能会更好一些。下面我们举例说明怎样使用这个类及其相关的FilenameFilter接口。 目录列表器 假设你想看看这个目录。有两个办法。一是不带参数调用list( )。它返回的是File对象所含内容的完整清单。但是,如果你要的是一个"限制性列表(restricted list)"的话——比方说,你想看看所有扩展名为.java的文件——那么你就得使用"目录过滤器"了。这是一个专门负责挑选显示File对象的内容的类。 下面就是源代码。看看,用了java.utils.Arrays.sort( )和11章的AlphabeticComparator之后,我们没费吹灰之力就对结果作了排序(按字母顺序): //: c12:DirList.java // Displays directory listing using regular expressions. // {Args: "D.*\.java"} import java.io.*; import java.util.*; import java.util.regex.*; import com.bruceeckel.util.*; public class DirList { public static void main(String[] args) { File path = new File("."); String[] list; if(args.length == 0) list = path.list(); else list = path.list(new DirFilter(args[0])); Arrays.sort(list, new AlphabeticComparator());

JAVA外文文献+翻译

Java and the Internet If Java is, in fact, yet another computer programming language, you may question why it is so important and why it is being promoted as a revolutionary step in computer programming. The answer isn’t immediately obvious if you’re coming from a traditional programming perspective. Although Java is very useful for solving traditional stand-alone programming problems, it is also important because it will solve programming problems on the World Wide Web. 1.Client-side programming The Web’s in itial server-browser design provided for interactive content, but the interactivity was completely provided by the server. The server produced static pages for the client browser, which would simply interpret and display them. Basic HTML contains simple mechanisms for data gathering: text-entry boxes, check boxes, radio boxes, lists and drop-down lists, as well as a button that can only be programmed to reset the data on the form or “submit” the data on the form back to the server. This submission passes through the Common Gateway Interface (CGI) provided on all Web servers. The text within the submission tells CGI what to do with it. The most common action is to run a program located on the server in a directory that’s typically called “cgi-bin.” (If you watch the address window at the top of your browser when you push a button on a Web page, you can sometimes see “cgi-bin” within all the gobbledygook there.) These programs can be written in most languages. Perl is a common choice because it is designed for text manipulation and is interpreted, so it can be installed on any server regardless of processor or operating system. Many powerful Web sites today are built strictly on CGI, and you can in fact do nearly anything with it. However, Web sites built on CGI programs can rapidly become overly complicated to maintain, and there is also the problem of response time. The response of a CGI program depends on how much data must

JAVA外文文献翻译基于Java技术的Web应用设计模型的比较研究

中文翻译 基于Java技术的Web应用设计模型的比较研究 来源:School of Computer Science and Engineering University of New South Wales Sydney, NSW 2052, Australia 作者:Budi Kurniawan and Jingling Xue 摘要 Servlet技术是在建立可扩展性Web应用中被应用最广泛的技术。在运用JAVA技术开发Web应用中有四种模型,分别是:Model 1、Model 2、Struts和JavaServer Faces JSF。Model 1使用一连串的JSP页面,Model 2采用了模型,视图,控制器MVC模式。Struts是一个采用了Model 2设计模型的框架,JSF是一种支持ready-to-use组件来进行快速Web应用开发的新技术。Model 1对于中等和大型的应用来说很难维护,所以不推荐使用。本文通过利用Model 2、Struts和JSF这三种模型分别构建三个不同版本的在线商店应用程序来比较和评价这三种模型在应用程序开发和性能上的差异。 1.绪论 当今Web应用是一种展现动态内容的最普遍的方式。构建Web应用有许多种方法,其中最流行的是Servlet技术。这种技术的流行是因为它比CGI、PHP等其他技术更具优越性。然而Servlet对于开发来说还是麻烦的,因为它在传送HTML 标签时需要程序员将他们组合成为一个字符串对象,再将这个对象传给浏览器。同样的,对于输出的一个很小的改动也要求Servlet被重新编译。基于这个原因SUN 公司发明了JavaServer Pages JSP技术。JSP允许HTML标签和Java代码混合在

JAVA思想外文翻译毕业设计

文献来源:Bruce Eckel.Thinking in Java [J]. Pearson Higher Isia Education,2006-2-20. Java编程思想 (Java和因特网) 既然Java不过另一种类型的程序设计语言,大家可能会奇怪它为什么值得如此重视,为什么还有这么多的人认为它是计算机程序设计的一个里程碑呢?如果您来自一个传统的程序设计背景,那么答案在刚开始的时候并不是很明显。Java除了可解决传统的程序设计问题以外,还能解决World Wide Web(万维网) 上的编程问题。 1、客户端编程 Web最初采用的“服务器-浏览器”方案可提供交互式内容,但这种交互能力完全由服务器提供,为服务器和因特网带来了不小的负担。服务器一般为客户浏览器产生静态网页,由后者简单地解释并显示出来。基本HTML语言提供了简单的数据收集机制:文字输入框、复选框、单选钮、列表以及下拉列表等,另外还有一个按钮,只能由程序规定重新设置表单中的数据,以便回传给服务器。用户提交的信息通过所有Web服务器均能支持的“通用网关接口”(CGI)回传到服务器。包含在提交数据中的文字指示CGI该如何操作。最常见的行动是运行位于服务器的一个程序。那个程序一般保存在一个名为“cgi-bin”的目录中(按下Web页内的一个按钮时,请注意一下浏览器顶部的地址窗,经常都能发现“cgi-bin”的字样)。大多数语言都可用来编制这些程序,但其中最常见的是Perl。这是由于Perl是专为文字的处理及解释而设计的,所以能在任何服务器上安装和使用,无论采用的处理器或操作系统是什么。 2、脚本编制语言 插件造成了脚本编制语言的爆炸性增长。通过这种脚本语言,可将用于自己客户端程序的源码直接插入HTML页,而对那种语言进行解释的插件会在HTML 页显示的时候自动激活。脚本语言一般都倾向于尽量简化,易于理解。而且由于它们是从属于HTML页的一些简单正文,所以只需向服务器发出对那个页的一

Java的面向对象编程外文资料翻译

毕业设计(论文)外文资料翻译 系:计算机系 专业:计算机科学与技术 姓名: 学号: 外文出处:Ghosh,D..Java Object-oriented (用外文写) programming[J]. IEEE Transactions on Software Engineering,2009, 13(3):42-45. 附件: 1.外文资料翻译译文;2.外文原文。

注:请将该封面与附件装订成册。

附件1:外文资料翻译译文 Java的面向对象编程 ——面向对象编程和它的关键技术—继承和多态性 软件的重用可以节省程序开发时间。它鼓励重复使用已经调试好的高质量的软件,从而减少系统运行后可能出现的问题。这些都是令人振奋的可能性。多态性允许我们用统一的风格编写程序,来处理多种已存在的类和特定的相关类。利用多态性我们可以方便地向系统中添加新的功能。继承和多态对于解决软件的复杂性是一种有效可行的技术。当创建一个新的类时,而不用完整的写出新的实例变量和实例方法,程序员会指定新的类继承已定义的超类的实例变量和实例方法。这个新的类被称为一个子类。每个子类本身将来亦可有新的子类,而其本身将成为父类。一个类的直接父类就是该类所直接继承的类(通过关键字extends继承)。一个间接超类是通过从两级或更多级以上的类继承而来的。例如,从类JApplet(包javax.swing 中)扩展来的类Applet(包java.applet)。一个类单一的从一个父类继承而来。 Java 不支持多重继承(而C++可以),但它支持接口的概念。接口可以使Java实现许多通过多重继承才能实现的优点而没有关联的问题。我们将在本章讨论的接口的详细内容。我们会给出创建和使用接口的一般规律和具体实例。一个子类通常添加自己的实例变量和自己的实例方法,因此子类通常比父类大。一个子类比它的父类更具体并且代表一组更小、更专业的对象。通过单一继承,子类在开始时拥有父类的所有特性。继承性真正的力量在于它可以在定义子类时增加或取代从超类中继承来的特征。每个子类对象也是该类的父类的对象。例如,每一个我们所定义的小程序被认为是类JApplet 的对象。此外,因为Japplet继承了Applet,每一个我们所定义的小程序同时也被认为是一个Applet 的对象。当开发applets时,这些信息是至关重要的,因为一个小程序容器只有当它是一个Applet才可以执行一个程序。虽然子类对象始终可以作为它的父类的一种来看待,父类对象却不被认为是其子类类型的对象。我们将利用这种“子类对象是父类对象”的关系来执行一些强大的操作。例如,绘图程序可以显示一系列图形,如果所有的图形类型都直接或间接地继

java外文翻译

毕业设计外文资料翻译 (译文) 题目名称:Java and the Internet 学院:计算机科学技术 专业年级:计算机科学与技术(师)08 级 学生姓名:aaa 班级学号:a班a号 指导教师:aaa

二○一一年五月十三日 译文题目:Java和因特网 原文题目:Java and the Internet 原文出处:https://www.doczj.com/doc/a912376.html,/view.html

Java and the Internet If Java is, in fact, yet another computer programming language, you may question why it is so important and why it is being promoted as a revolutionary step in computer programming. The answer isn’t immediately obvious if you’re coming from a traditional programming perspective. Although Java is very useful for solving traditional stand-alone programming problems, it is also important because it will solve programming problems on the World Wide Web. 1.Client-side programming The Web’s initial server-browser design provided for interactive content, but the interactivity was completely provided by the server. The server produced static pages for the client browser, which would simply interpret and display them. Basic HTML contains simple mechanisms for data gathering: text-entry boxes, check boxes, radio boxes, lists and drop-down lists, as well as a button that can only be programmed to reset the data on the form or “submit” the data on the form back to the server. This submission passes through the Common Gateway Interface (CGI) provided on all Web servers. The text within the submission tells CGI what to do with it. The most common action is to run a program located on the server in a directory that’s typically called “cgi-bin.” (If you watch the address window at the top of your browser when you push a button on a Web page, you can so metimes see “cgi-bin” within all the gobbledygook there.) These programs can be written in most languages. Perl is a common choice because it is designed for text manipulation and is interpreted, so it can be installed on any server regardless of processor or operating system. Many powerful Web sites today are built strictly on CGI, and you can in fact do nearly anything with it. However, Web sites built on CGI programs can rapidly become overly complicated to maintain, and there is also the problem of response time. The response of a CGI program depends on how much data must be sent, as well as the load on both the server and the Internet. (On top of this, starting a CGI program tends to be slow.) The initial designers of the Web did not foresee how rapidly this bandwidth would be exhausted for the kinds of applications people developed. For example, any sort of dynamic graphing is nearly impossible to perform with consistency because a GIF file must be created and moved from the server to the client for eac h version of the graph. And you’ve no doubt had direct experience with something as simple as validating the data on an input form. You press the submit button on a page; the data is shipped back to the server; the server starts a CGI program that discovers an error, formats an HTML page informing you of the error, and then sends the page back to you; you must then back up a page and try again. Not only is this slow, it’s inelegant. The solution is client-side programming. Most machines that run Web browsers are powerful engines capable of doing vast work, and with the original static HTML

15000字的Java外文翻译

xxxx大学高新学院毕业设计(论文) 外文翻译 学生姓名: 院(系): 专业班级: 指导教师: 完成日期:

JSP基础学习资料 一、JSP 技术概述 在Sun 正式发布JSP(JavaServer Pages) 之后,这种新的Web 应用开发技术很快引起了人们的关注。JSP 为创建高度动态的Web 应用提供了一个独特的开发环境。按照Sun 的说法,JSP 能够适应市场上包括Apache WebServer 、IIS4.0 在内的85% 的服务器产品。即使您对ASP “一往情深”,我们认为,关注JSP 的发展仍旧很有必要。 ㈠JSP 与ASP 的简单比较 JSP 与Microsoft 的ASP 技术非常相似。两者都提供在HTML 代码中混合某种程序代码、由语言引擎解释执行程序代码的能力。在ASP 或JSP 环境下,HTML 代码主要负责描述信息的显示样式,而程序代码则用来描述处理逻辑。普通的HTML 页面只依赖于Web 服务器,而ASP 和JSP 页面需要附加的语言引擎分析和执行程序代码。程序代码的执行结果被重新嵌入到HTML 代码中,然后一起发送给浏览器。ASP 和JSP 都是面向Web 服务器的技术,客户端浏览器不需要任何附加的软件支持。 ASP 的编程语言是VBScript 之类的脚本语言,JSP 使用的是Java ,这是两者最明显的区别。此外,ASP 与JSP 还有一个更为本质的区别:两种语言引擎用完全不同的方式处理页面中嵌入的程序代码。在ASP 下,VBScript 代码被ASP 引擎解释执行;在JSP 下,代码被编译成Servlet 并由Java 虚拟机执行,这种编译操作仅在对JSP 页面的第一次请求时发生。 ㈡运行环境 Sun 公司的JSP 主页在https://www.doczj.com/doc/a912376.html,/products/jsp/index.html ,从这里还可以下载JSP 规范,这些规范定义了供应商在创建JSP 引擎时所必须遵从的一些规则。 执行JSP 代码需要在服务器上安装JSP 引擎。此处我们使用的是Sun 的JavaServer Web Development Kit (JSWDK )。为便于学习,这个软件包提供了大量可供修改的示例。安装JSWDK 之后,只需执行startserver 命令即可启动服务器。在默认配置下服务器在端口8080 监听,使用http://localhost:8080 即可打开缺省页面。 在运行JSP 示例页面之前,请注意一下安装JSWDK 的目录,特别是“ work ”子目录下的内容。执行示例页面时,可以在这里看到JSP 页面如何被转换成Java 源文件,然后又被编译成class 文件(即Servlet )。JSWDK 软件包中的示例页

java外文翻译资料

*** 学院 毕业设计(论文)外文资料翻译 系(院):计算机工程学院 专业:计算机科学与技术(软件技术)姓名:*** 学号:*** 外文出处:The Programmer (用外文写) 附件: 1.外文资料翻译译文;2.外文原文。

注:请将该封面与附件装订成册。

附件1:外文资料翻译译文 JSP技术概述 JSP的优点 JSP页面最终会转换成servler。因而,从根本上,JSP页面能够执行的任何任务都可以用servler来完成。然而,这种底层的等同性并不意味着servler和JSP页面对于所有的情况都等同适用。问题不在于技术的能力,而是二者在便利性、生产率和可维护性上的不同。毕竟,在特定平台上能够用Java编程语言完成的事情,同样可以用汇编语言来完成,但是选择哪种语言依旧十分重要。 和单独使用servler相比,JSP提供下述好处: (1)JSP中HTML的编写与维护更为简单。JSP中可以使用常规的HTML:没有额外的反斜杠,没有额外的双引号,也没有暗含的Java语法。 (2)能够使用标准的网站开发工具。即使对那些对JSP一无所知的HTML 工具,我们也可以使用,因为它们会忽略JSP标签(JSP tags)。 (3)可以对开发团队进行划分。Java程序员可以致力于动态代码。Web 开发人员可以将经理集中在表示层(presentation layer)上。对于大型的项目,这种划分极为重要。依据开发团队的大小,及项目的复杂程度,可以对静态HTML和动态内容进行弱分离(weaker separation)和强分离(stronger separation)。 在此,这个讨论并不是让您停止使用servlets,只使用JSP。几乎所有的项目都会同时用到这两种技术。针对项目中的某些请求,您可能会在MVC构架下组合使用这两项技术。我们总是希望用适当的工具完成相对应的工作,仅仅是servlet并不能填满您的工具箱。 JSP相对于竞争技术的优势

(完整版)Java外文翻译1毕业设计

以下文档格式全部为word格式,下载后您可以任意修改编辑。 毕业设计(论文)外文文献翻 译 译文: Java IO 系统[1] 对编程语言的设计者来说,创建一套好的输入输出(IO)系统,是一项难度极高的任务。 这一类可以从解决方案的数量之多上看出端倪。这个问题就难在它要面对的可能性太多了。不仅是因为有那么多的IO的源和目的(文件,控制台,网络连接等等),而且还有很多方法(顺序的,随机的,缓存的,二进制的,字符方式的,行的,字的等等)。 Java类库的设计者们用“创建很多类”的办法来解决这个问题。坦率地说,Java IO系统的类实在太多了,以至于初看起来会把人吓着(但是,具有讽刺意味的是,这种设计实际上是限制了类的爆炸性增长)。此外,Java在1.0版之后又对其IO类库进行了重大的修改,原先是面向byte的,现在又补充了面向Unicode字符的类库。为了提高性能,完善功能,JDK1.4又加了一个nio(意思是“new IO”。这个名字会用上很多年)。这么以来,如果你想对Java 的IO类库有个全面了解,并且做到运用自如,你就得先

学习大量的类。此外,了解IO类库的演化历史也是相当重要的。可能你的第一反应是“别拿什么历史来烦我了,告诉我怎么用就可以了!”但问题是,如果你对这段一无所知,很快就会被一些有用或是没用的类给搞糊涂了。 本文会介绍Java 标准类库中的各种IO类,及其使用方法。 File 类 在介绍直接从流里读写数据的类之前,我们先介绍一下处理文件和目录的类。 你会认为这是一个关于文件的类,但它不是。你可以用它来表示某个文件的名字,也可以用它来表示目录里一组文件的名字。如果它表示的是一组文件,那么你还可以用list( )方法来进行查询,让它会返回String 数组。由于元素数量是固定的,因此数组会比容器更好一些。如果你想要获取另一个目录的清单,再建一个File对象就是了。 目录列表器 假设你想看看这个目录。有两个办法。一是不带参数调用list( )。它返回的是File对象所含内容的完整清单。但是,如果你要的是一个"限制性列表(restricted list)"的话——比方说,你想看看所有扩展名为.java的文件——那么你就得使用"目录过滤器"了。这是一个专门负责挑选显示File对象的内容的类。 FilenameFilter接口的声明: public interface FilenameFilter { boolean accept(File dir, String name); } accept( )方法需要两个参数,一个是File对象,表示这个文件是在

(完整版)毕设外文翻译-详细解析Java中抽象类和接口的区别

Parsing Java Abstraction of the Difference Between Classes and Interfaces In Java language, abstract scale-up and with support class abstraction definition of two mechanisms. Because of these two kinds of mechanism of existence, just gives Java powerful object-oriented skills. Abstract scale-up and with between classes abstraction definition for support has great similarities, even interchangeable, so many developers into line non-abstract class definition for abstract scale-up and it is becoming more casual with choice. In fact, both between still has the very big difference, for their choice even reflected in problem domain essence of understanding, to design the intentions of the understanding correctly and reasonable. This paper will for the difference analysis, trying to give a developer with a choice between them are based. Understand class abstraction Abstract class and interface in Java language is used for abstract classes (in this article non-abstract class not from abstract scale-up translation, it represents an abstract body, and abstract scale-up for Java language used to define class abstraction in one way, please readers distinguish) defined, then what are the abstract classes, use abstract classes for us any good? In object-oriented concept, we know all objects is through class to describe, but in turn not such. Not all classes are used to describe object, if a class does not contain enough information to portray a concrete object, this class is abstract classes. Abstract classes are often used to characterization of problem field in our analysis, design that the abstract concepts, is to the series will look different, but essentially the same exact conception of abstraction. For example: if we carry out a graphical editing software development, will find problem domain exists round, triangle so some specific concept, they are different, but they all belong to shape such a concept, shape this concept in problem domain is not exist, it is an abstract concept. Precisely because the abstract concepts in problem field no corresponding specific concept, so to characterization abstract concepts non-abstract class cannot be instantiated. In an object-oriented field, mainly used for class abstraction types hidden. We can

java介绍外文翻译

外文原文 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 applications 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, reliable, 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 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 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 in 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 schemes 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 developers can easily learn Java; object oriented, to take advantage of modern software development methodologies and to fit into distributed client-server applications;

java毕业论文外文文献翻译

Advantages of Managed Code Microsoft intermediate language shares with Java byte code the idea that it is a low-level language witha simple syntax , which can be very quickly translated intonative machine code. Having this well-defined universal syntax for code has significant advantages. Platform independence First, it means that the same file containing byte code instructions can be placed on any platform; atruntime the final stage of compilation can then be easily accomplished so that the code will run on thatparticular platform. In other words, by compiling to IL we obtain platform independence for .NET, inmuch the same way as compiling to Java byte code gives Java platform independence. Performance improvement IL is actually a bit more ambitious than Java bytecode. IL is always Just-In-Time compiled (known as JIT), whereas Java byte code was ofteninterpreted. One of the disadvantages of Java was that, on execution, the process of translating from Javabyte code to native executable resulted in a loss of performance. Instead of compiling the entire application in one go (which could lead to a slow start-up time), the JITcompiler simply compiles each portion of code as it is called (just-in-time). When code has been compiled.once, the resultant native executable is stored until the application exits, so that it does not need to berecompiled the next time that portion of code is run. Microsoft argues that this process is more efficientthan compiling the entire application code at the start, because of the likelihood that large portions of anyapplication code will not actually be executed in any given run. Using the JIT compiler, such code willnever be compiled.

相关主题
文本预览
相关文档 最新文档