基于Java的消灭苹果游戏外文翻译资料

 2022-12-19 05:12

外文原文

Introduction to Java

Author: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; multithreaded, for high performance in applications that need to perform multiple concurrent activities, such as multimedia; and interpreted, for maximum portability and dynamic capabilities.

Together, the above requirements comprise quite a collection of buzzwords, so let rsquo;s examine some of them and their respective benefits before going on.

Whatrsquo;s completely new is the manner in which Java and its run-time system have combined them 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 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 used for prototyping. One of the reasons for their success at this is that they are very robust —you don rsquo;have to t 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 programmerrsquo;s job vastly easier; with the burden of memory management taken off the programmerrsquo;s shoulders, storage allocation errors go away. Another reason commonly given that languages like Lisp, TCL, and SmallTalk are good for prototyping is that they do not require you to pin down decisions early on—these 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 do not have to worry about method invocation error.

The Java beginner must grasp 30 basic concepts

Basic concept

1.In OOP the only relations is what the objectrsquo;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 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 inter-communion are invoke through the method invocation, By object data encapsulation, 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 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 introduction..

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 identity and among three characteristics they affect mutually.

6. Relations among classes:

Use-a:Dependent relation .

Has-a:Polymerization relation .

lt;

剩余内容已隐藏,支付完成后下载完整资料


中文翻译

JAVA 介绍

作者: Martin Ngobye.

出处: Computing Static Slice for Java Programs

Java是被设计用来解决在上下文分布式的异构网络中应用程序开发的问题。在这些

复杂问题中,首要的是安全发布应用程序、消耗最小的系统资源、可以在任何硬件和软

件平台上运行以及被动态地扩展。

Java最初是作为研发方案的一部分而开发的,这个研究方案是为了给广阔多样的网

络设备和嵌入式系统开发高级的软件。 目标是开发一个小巧的、 可靠性高的、 可移植的、

分布式的、实时的操作系统平台。当这个方案开始的时候, C 是精选的语言,但是过

了一段时间, 用 C 语言遇到的困难也随之增长, 解决这些问题最好的办法是创造一个

全新的语言平台。设计和体系结构的决定汲取了多种语言,例如 Eiffel、 SmallTalk、

Objective C 以及 Cedar/Mesa。结果证明这个语言平台是理想的,对于开发一个可靠性

高的、可移植的、分布式的、基于终端用户网络的应用程序在多种环境中广泛搜索从嵌

入网络的设备到万维网和桌上型电脑。

Java的需求设计通过自然状态的,在软件必须被配置的处理环境中被推动的。

因特网和万维网的巨大发展导致我们完全地以新的情形着眼于开发和发行软件。对

于全球电子化的商业和销售发行的存在, Java必须使安全的, 高性能的和非常健壮的应

用程序在多平台异构的,分布式的网络中开发。

在异构的网络中,多平台上运行会使传统配置的二进制发送、释放、更新、补丁等

等无效。为了在这些问题中幸存下来, Java必须是体系结构中立的、可移植的以及可以

被动态的修改。

为满足以上的需求而开发的 Java系统是简单的,所以它能够被绝大多数的程序员进

行编程;熟悉的,所以当前的程序员学习 Java语言是简单的; 面向对象的,为了利用现

代的软件开发方法学和适合分布式的客户机 /服务器应用程序; 多线程的,为了高性能在

应用程序中需要执行多个并发的活动 ,例如多媒体; 解释的,为了最大极限的可移植和动

态的容量。

同时,以上的需求完全是由收集的时髦词语组成的,所以在开始以前让我们来查看

它们中的一些和它们的各自的优点。

什么是完全新的, 样式风格在 Java语言和它的运行系统结合它们来产生一个灵通的

且强大的编程系统。

在软件中,用 Java语言开发的你的应用程序可以在多种机器总体结构、操作系统和

图形用户接口之间移植。 运用 Java语言,诸如软件开发者的工作就会变得简单的多——

你会把你的全部精力都集中在最终的目标:准时运送革新的产品、基于可靠的构造的

Java语言。较好的开发软件的方法在这里,现在, Java语言平台会带给你这些。

许多动态的语言像 Lisp、TCL 和 SmallTalk 通常被应用于原型构造技术它们成功原因中的一个在于它们非常健壮——你没有必要去担心关于解除或破坏存储器。

同样的,程序员可以相对大胆的处理存储器 ,当在 Java语言里面编程的时候。垃圾

回收系统使程序员的工作大为容易,卸下了程序员肩上存储管理之负担,存储分配错误不再发生。

一般认为像 Lisp, TCL, 和 SmallTalk 这样一些语言十分适合于原型法的另一个理由,是因为它们不要求你受早期决定的约束——这些语言的语义是很丰富的。

Java语言有着严密的对应的属性:它促使你做出清楚的选择。伴随着这些选择带来

了许多的协助——你可以写一个方法调用,而且如果你在编写时有一些错误的时候,在

编译的时候将会被告知。你没有必要去担心关于方法调用的错误。

Java初学者需掌握的 30 个基本概念

基本概念:

1.OOP 中唯一关系是什么是对象的接口,就像计算机的销售商不管电源内部结构是怎样的,它只关心能否给你提供电,也就是只要知道能或不能而不是知道怎样和为什么会有电。所有的程序是由一定的属性和行为对象组成的,不同的对象的访问通过函数调用来完成,对象间所有的交流都是通过方法调用,通过封装对象数据,很大限度上提高复用率。

2.OOP 中最重要的思想是类,类是模板是蓝图,从类中构造一个对象,即创建了这个类的一个实例 (instance)。

3.封装:就是把数据和行为结合起在一个包中,并对对象使用者隐藏数据的实现过程,一个对象中的数据叫他的实例字段 (instance field)。

4.通过扩展一个类来获得一个新类叫继承 (inheritance),而所有的类都是由 Object根超类扩展而得,根超类下文会做介绍。

5.对象的 3 个主要特性:

Behavior——说明这个对象能做什么。

Tate——当对象施加方法时对象的反映。

Dentity——与其他相似行为对象的区分标志。

每个对象有唯一的 indentity 而这 3 者之间相互影响。

6.类之间的关系:

use-a :依赖关系

has-a :聚合关系

is-a :继承关系——例: A 类继承了 B 类,此时 A 类不仅有了 B 类的方法,还有其自己的方法 (个性存在于共性中 )。

7.构造对象使用构造器: 构造器的提出,构造器是一种特殊的方法,构造对象并对其初始化。

例:Data 类的构造器叫 Data。

New Data()——构造一个新对象,且初始化当前时间。

Data happyday=new Data()——把一个对象赋值给一个变量 happyday,从而使该对象

能够多次使用,此处要声明的使变量与对象变量二者是不同的。

new 返回的值是一个引用。

构造器特点 :构造器可以有 0 个,一个或多个参数。

构造器和类有相同的名字。

一个类可以有多个构造器 ,构造器没有返回值 ,构造器总是和 new 运算符一起使用。

8.重载:当多个方法具有相同的名字而含有不同的参数时,便发生重载 .编译器必须挑选出调用哪个方法。

9.包(package)Java允许把一个或多个类收集在一起成为一组,称作包,以便于组织任务,标准 Java库分为许多包 Java.lang java.util java,net等,包是分层次的所有的 java包都在 java 和 javax 包层次内。

10.继承思想:允许在已经存在的类的基础上构建新的类,当你继承一个已经存在的

类时,那么你就复用了这个类的方法和字段, 同时你可以在新类中添加新的方法和字段。

11.扩展类:扩展类充分体现了 is-a 的继承关系, 形式为:class (子类) extends (基类)。

12.多态:在 java 中,对象变量是多态的,而 java 中不支持多重继承。

13.动态绑定:调用对象方法的机制。

1)编译器检查对象声明的类型和方法名。

2)编译器检查方法调用的参数类型。

3)静态绑定:若方法类型为 priavte static final 编译器会准确知道该调用哪个方法。

4)当程序运行并且使用动态绑定来调用一个方法时, 那么虚拟机必须调用 x 所指向的对象的实际类型相匹配的方法版本。

5)动态绑定:是很重要的特性,它能使程序变得可扩展而不需要重编译已存代码。

14.final 类:为防止他人从你的类上派生新类,此类是不可扩展的。

15.动态调用比静态调用花费的时间要长。

16.抽象类:规定一个或多个抽象方法的类本身必须定义为 abstract。

例::public abstract string getDescripition

17.Java中的每一个类都是从 Object 类扩展而来的。

18.object 类中的 equal和 toString 方法。

equal 用于测试一个对象是否同另一个对象相等。

toString 返回一个代表该对象的字符串, 几乎每一个类都会重载该方法, 以便返回当前状态的正确表示 (toString 方法是一个很重要的方法 )。

19.通用编程:任何类类型的所有值都可以同 object 类性的变量来代替。

20.数组列表: ArrayList 动态数组列表,是一个类库,定义在 java.uitl 包中,可自动调节数组的大小。

21.class类 object 类中的 getclass方法返回 class类型的一个实例,程序启动时包含在 main 方法的类会被加载,虚拟机要加载他需要的所有类,每一个加载的类都要加载

它需要的类。

22.class 类为编写可动态操纵 java 代码的程序提供了强大的功能反射,这项功能为JavaBeans特别有用,使用反射 Java能支持 VB 程序员习惯使用的工具。

能够分析类能力的程序叫反射器, Java中提供此功能的包叫 Java.lang.reflect反射机制十分强大。

1)在运行时分析类的能力。

2)在运行时探察类的对象。

3)实现通用数组操纵代码。

4)提供方法对象。

而此机制主要针对是工具者而不是应用及程序。

反射机制中的最重要的部分是允许你检查类的结构 .用到的 API 有:

java.lang.reflect.Field 返回字段。

java.reflect.Method 返回方法。

java.lang.reflect.Constructor 返回参数。

方法指针 :java 没有方法指针,把一个方法的地址传给另一个方法,可以在后面调用

它,而接口是更好的解决方案。

23.接口 (Interface)说明类该做什么而不指定如何去做,一个类可以实现一个或多个interface。

24.接口不是一个类,而是对符合接口要求的类的一套规范。

若实现一个接口需要 2 个步骤:

1)声明类需要实现的指定接口。

2)提供接口中的所有方法的定义。

声明一个类实现一个接口需要使用 implements 关键字。

class actionB implements Comparable 其 actionb 需要提供 CompareTo方法,接口不是类,不能用 new 实例化一个接口。

25.一个类只有一个超类,但一个类能实现多个接口。

Java 中的一个重要接口:Cloneable。

26.接口和回调 .编程一个常用的模式是回调模式,在这种模式中你可以指定当一个特定时间发生时回调对象上的方法。

例:ActionListener 接口监听。

类似的 API 有:

java.swing.JOptionPane

java.swing.Timer

java.awt.Tookit

27.对象 clone:clone方法是 object 一个保护方法, 这意味着你的代码不能简单的调用它。

28.内部类:一个内部类的定义是定义在另一个内部的类。

原因是:

1)一个内部类的对象能够访问创建它的对象的实现,包括私有数据。

2)对于同一个包中的其他类来说,内部类能够隐藏起来。

3)匿名内部类可以很方便的定义回调。

4)使用内部类可以非常方便的编写事件驱动程序。

29.代理类 (proxy):

1)指定接口要求所有代码。

2)object 类定义的所有的方法 (toString equals)。

30.数据类型: Java是强调类型的语言,每个变量都必须先申明它的类型, java中总共有 8 个基本类型: 4 种是整型, 2 种是浮点型,一种是字符型,被用于 Unicode 编码中的字符,布尔型。

Java的优点如下:

1.Java是简单的

Java与 C 极为相似,但却简单得多。高级编程语言的所有特性中,不是绝对需要

的都已删去了。例如, Java没有算符过载、标题文件、预处理、指针运算、结构、联合、

多维数组、模板及隐式类型变换。如果你知道一点 C、C 或 Pascal,你很快就会驾驭

Java。这里是一个简单的 JavaHelloWorld 程序:

publicclassHelloInternet{

publicstaticvoidmain(Stringargv[]){

System。out。println(“HelloIn-ternet!”)

}

}

2.Java是面向对象的

Java 是一种面向对象的编程语言。除了简单的类型,如数字和布尔算子之外, Java中的大部分都是对象。正如任何面向对象的语言一样, Java代码也按类组织。每个类定义一组规定对象行为的方法。一个类可以继承另一个类的行为。在类的根层次上,通常是类对象。 Java支持单继承类层次结构。这就是说,每个类一次只能继承

剩余内容已隐藏,支付完成后下载完整资料


资料编号:[19904],资料为PDF文档或Word文档,PDF文档可免费转换为Word

原文和译文剩余内容已隐藏,您需要先支付 30元 才能查看原文和译文全部内容!立即支付

以上是毕业论文外文翻译,课题毕业论文、任务书、文献综述、开题报告、程序设计、图纸设计等资料可联系客服协助查找。