Java语言与面向对象思想翻译(中英文)
Java编程语言外文翻译、英汉互译、中英对照
文档从互联网中收集,已重新修正排版,word格式支持编辑,如有帮助欢迎下载支持。
外文翻译原文及译文学院计算机学院专业计算机科学与技术班级学号姓名指导教师负责教师Java(programming language)Java is a general-purpose, concurrent, class-based, object-oriented computer program- -ming language that is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that code that runs on one platform does not need to be recompiled to run on another. Java applications are typically compiled to byte code (class file) that can run on any Java virtual machine(JVM) regardless of computer architecture. Java is, as of 2012, one of the most popular programming languages in use, particularly for client-server web applications, with a reported 10 million users. Java was originally developed by James Gosling at Sun Microsystems (which has since merged into Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them.The original and reference implementation Java compilers, virtual machines, and class libraries were developed by Sun from 1991 and first released in 1995. As of May 2007, in compliance with the specifications of the Java Community Process, Sun relicensed most of its Java technologies under the GNU General Public License. Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java and GNU Classpath.Java is a set of several computer software products and specifications from Sun Microsystems (which has since merged with Oracle Corporation), that together provide a system for developing application software and deploying it in across-platform computing environment. Java is used in a wide variety of computing platforms from embedded devices and mobile phones on the low end, to enterprise servers and supercomputers on the high end. While less common, Java appletsare sometimes used to provide improved and secure functions while browsing the World Wide Web on desktop computers.Writing in the Java programming language is the primary way to produce code that will be deployed as Java bytecode. There are, however, byte code compilers available forother languages such as Ada, JavaScript, Python, and Ruby. Several new languages have been designed to run natively on the Java Virtual Machine (JVM), such as Scala, Clojure and Groovy.Java syntax borrows heavily from C and C++, but object-oriented features are modeled after Smalltalk and Objective-C. Java eliminates certain low-level constructs such as pointers and has a very simple memory model where every object is allocated on the heap and all variables of object types are references. Memory management is handled through integrated automatic garbage collection performed by the JVM.An edition of the Java platform is the name for a bundle of related programs from Sun that allow for developing and running programs written in the Java programming language. The platform is not specific to any one processor or operating system, but rather an execution engine (called a virtual machine) and a compiler with a set of libraries that are implemented for various hardware and operating systems so that Java programs can run identically on all of them. The Java platform consists of several programs, each of which provides a portion of its overall capabilities. For example, the Java compiler, which converts Java source code into Java byte code (an intermediate language for the JVM), is provided as part of the Java Development Kit (JDK). The Java Runtime Environment(JRE), complementing the JVM with a just-in-time (JIT) compiler, converts intermediate byte code into native machine code on the fly. An extensive set of libraries are also part of the Java platform.The essential components in the platform are the Java language compiler, the libraries, and the runtime environment in which Java intermediate byte code "executes" according to the rules laid out in the virtual machine specification.In most modern operating systems (OSs), a large body of reusable code is provided to simplify the programmer's job. This code is typically provided as a set of dynamically loadable libraries that applications can call at runtime. Because the Java platform is not dependent on any specific operating system, applications cannot rely on any of the pre-existing OS libraries. Instead, the Java platform provides a comprehensive set of its own standard class libraries containing much of the same reusable functions commonly found in modern operating systems. Most of the system library is also written in Java. For instance, Swing library paints the user interface and handles the events itself, eliminatingmany subtle differences between how different platforms handle even similar components.The Java class libraries serve three purposes within the Java platform. First, like other standard code libraries, the Java libraries provide the programmer a well-known set of functions to perform common tasks, such as maintaining lists of items or performing complex string parsing. Second, the class libraries provide an abstract interface to tasks that would normally depend heavily on the hardware and operating system. Tasks such as network access and file access are often heavily intertwined with the distinctive implementations of each platform. The and java.io libraries implement an abstraction layer in native OS code, then provide a standard interface for the Java applications to perform those tasks. Finally, when some underlying platform does not support all of the features a Java application expects, the class libraries work to gracefully handle the absent components, either by emulation to provide a substitute, or at least by providing a consistent way to check for the presence of a specific feature.The success of Java and its write once, run anywhere concept has led to other similar efforts, notably the .NET Framework, appearing since 2002, which incorporates many of the successful aspects of Java. .NET in its complete form (Microsoft's implementation) is currently only fully available on Windows platforms, whereas Java is fully available on many platforms. .NET was built from the ground-up to support multiple programming languages, while the Java platform was initially built to support only the Java language, although many other languages have been made for JVM since..NET includes a Java-like language called Visual J# (formerly named J++) that is incompatible with the Java specification, and the associated class library mostly dates to the old JDK 1.1 version of the language. For these reasons, it is more a transitional language to switch from Java to the .NET platform, than a first class .NET language. Visual J# was discontinued with the release of Microsoft Visual Studio 2008. The existing version shipping with Visual Studio 2005will be supported until 2015 as per the product life-cycle strategy.In June and July 1994, after three days of brainstorming with John Gage, the Director of Science for Sun, Gosling, Joy, Naughton, Wayne Rosing, and Eric Schmidt, the team re-targeted the platform for the World Wide Web. They felt that with the advent of graphical web browsers like Mosaic, the Internet was on its way to evolving into the samehighly interactive medium that they had envisioned for cable TV. As a prototype, Naughton wrote a small browser, Web Runner (named after the movie Blade Runner), later renamed Hot Java.That year, the language was renamed Java after a trademark search revealed that Oak was used by Oak Technology. Although Java 1.0a was available for download in 1994, the first public release of Java was 1.0a2 with the Hot Java browser on May 23, 1995, announced by Gage at the Sun World conference. His announcement was accompanied by a surprise announcement by Marc Andreessen, Executive Vice President of Netscape Communications Corporation, that Netscape browsers would be including Java support. On January 9, 1996, the Java Soft group was formed by Sun Microsystems to develop the technology.Java编程语言Java是一种通用的,并发的,基于类的并且是面向对象的计算机编程语言,它是为实现尽可能地减少执行的依赖关系而特别设计的。
java英汉互译
java英汉互译Java是一种广泛使用的编程语言,它是一种面向对象的语言,最初由Sun Microsystems开发。
Java的设计目标是让开发者编写一次代码,然后可以在不同的平台上运行,这种特性被称为“一次编写,到处运行”。
Java的语法与C++类似,但是Java具有更强的安全性和可移植性。
Java的英汉互译是Java English-Chinese Translation,它是指将Java程序中的英文单词翻译成中文,或将中文翻译成英文。
Java英汉互译在软件开发中非常重要,因为Java程序中的注释、变量名、方法名等都需要进行翻译,以便程序员能够更好地理解和维护代码。
Java英汉互译的实现方式有多种,其中最常用的是使用翻译工具或翻译软件。
这些工具可以自动将Java程序中的英文单词翻译成中文,或将中文翻译成英文。
翻译工具的优点是速度快、准确度高,但是由于语言的复杂性,翻译工具有时会出现错误或不准确的翻译结果。
除了翻译工具,Java程序员还可以使用在线翻译网站或翻译软件进行英汉互译。
这些工具可以帮助程序员快速翻译Java程序中的英文单词,但是需要注意的是,翻译结果需要进行人工校对,以确保翻译的准确性和可读性。
在进行Java英汉互译时,程序员需要注意以下几点:1. 翻译结果需要符合语法规范,以便程序能够正常运行。
2. 翻译结果需要准确无误,以避免程序出现错误或漏洞。
3. 翻译结果需要易于理解和维护,以便程序员能够快速定位和修复问题。
总之,Java英汉互译是Java程序员必备的技能之一,它可以帮助程序员更好地理解和维护代码,提高程序的可读性和可维护性。
在进行翻译时,程序员需要注意翻译结果的准确性和可读性,以确保程序的正常运行和稳定性。
Unit2IntroductiontoJavaandObject-OrientedProgramming
Yang Liu
Simple introduction to java
• History of Java
Yang Liu
面向对象的基本概念--对象
• 对象有两个层次的概念:
– 现实生活中:对象表示现实世界中某个具体的 事物, 指客观世界的实体。 – 程序中:
Yang Liu
• 例如:你面前的这辆汽车是具体的事物,我 们称它为对象(object)。它由标识 (identity)、属性(attribute)和行为(behavior) 构成。
Yang Liu
Summary
• What’s the Object? The building blocks or model elements in Java programs are called objects. • What’s the Class? Objects that exhibit the same behavior can be grouped into categories called classes. • What’s the Message? Objects that collaborate to perform a task or solve a problem communicate with each other by sending messages.
• 现实世界中:类是现实世界同种对象 的共同特征的表示。简单的说就是一 个模板。
Java中英翻译
abstract (关键字) 抽象['.bstr.kt]access vt.访问,存取['.kses]'(n.入口,使用权)algorithm n.算法['.lg.riem]Annotation [java]代码注释[.n.u'tei..n]anonymous adj.匿名的[.'n.nim.s]'(反义:directly adv.直接地,立即[di'rektli, dai'rektli])apply v.应用,适用[.'plai]application n.应用,应用程序[,.pli'kei..n]' (application crash 程序崩溃) arbitrary a.任意的['ɑ:bitr.ri]argument n.参数;争论,论据['ɑ:gjum.nt]'(缩写args)assert (关键字) 断言[.'s.:t] ' (java 1.4 之后成为关键字)associate n.关联(同伴,伙伴) [.'s.u.ieit]attribute n.属性(品质,特征) [.'tribju:t]boolean (关键字) 逻辑的, 布尔型call n.v.调用; 呼叫; [k.:l]circumstance n.事件(环境,状况) ['s.:k.mst.ns]crash n.崩溃,破碎[kr..]cohesion内聚,黏聚,结合[k.u'hi:..n](a class is designed with a single, well-focoused purpose. 应该不止这点) command n. 命令,指令[k.'mɑ:nd](指挥, 控制) (command-line 命令行)Comments [java]文本注释['k.ments]compile [java] v.编译[k.m'pail]' Compilation n.编辑[,k.mpi'lei..n] const (保留字)constant n. 常量, 常数, 恒量['k.nst.nt]continue (关键字)coupling耦合,联结['k.pli.]making sure that classes know about other classes only through their APIs. declare [java]声明[di'kl..]default (关键字) 默认值; 缺省值[di'f.:lt]delimiter定义符; 定界符Encapsulation[java]封装(hiding implementation details)Exception [java]例外; 异常[ik'sep..n]entry n.登录项, 输入项, 条目['entri]enum (关键字)execute vt.执行['eksikju:t]exhibit v.显示, 陈列[ig'zibit]exist存在, 发生[ig'zist] '(SQL关键字exists)extends (关键字) 继承、扩展[ik'stend]false (关键字)final (关键字) finally (关键字)fragments段落; 代码块['fr.gm.nt]FrameWork [java]结构,框架['freimw.:k]Generic [java]泛型[d.i'nerik]goto (保留字) 跳转heap n.堆[hi:p]implements (关键字) 实现['implim.nt]import (关键字) 引入(进口,输入)Info n.信息(information [,inf.'mei..n] )Inheritance [java]继承[in'herit.ns] (遗传,遗产)initialize预置初始化[i'iz]instanceof (关键字) 运算符,用于引用变量,以检查这个对象是否是某种类型。
Java的面向对象编程外文资料翻译
毕业设计(论文)外文资料翻译系:计算机系专业:计算机科学与技术姓名:学号:外文出处:Ghosh,D..Java Object-oriented(用外文写)programming[J]. IEEE Transactionson SoftwareEngineering,2009, 13(3):42-45.附件: 1.外文资料翻译译文;2.外文原文。
注:请将该封面与附件装订成册。
附件1:外文资料翻译译文Java的面向对象编程——面向对象编程和它的关键技术—继承和多态性软件的重用可以节省程序开发时间。
它鼓励重复使用已经调试好的高质量的软件,从而减少系统运行后可能出现的问题。
这些都是令人振奋的可能性。
多态性允许我们用统一的风格编写程序,来处理多种已存在的类和特定的相关类。
利用多态性我们可以方便地向系统中添加新的功能。
继承和多态对于解决软件的复杂性是一种有效可行的技术。
当创建一个新的类时,而不用完整的写出新的实例变量和实例方法,程序员会指定新的类继承已定义的超类的实例变量和实例方法。
这个新的类被称为一个子类。
每个子类本身将来亦可有新的子类,而其本身将成为父类。
一个类的直接父类就是该类所直接继承的类(通过关键字extends继承)。
一个间接超类是通过从两级或更多级以上的类继承而来的。
例如,从类JApplet(包javax.swing 中)扩展来的类Applet(包java.applet)。
一个类单一的从一个父类继承而来。
Java 不支持多重继承(而C++可以),但它支持接口的概念。
接口可以使Java实现许多通过多重继承才能实现的优点而没有关联的问题。
我们将在本章讨论的接口的详细内容。
我们会给出创建和使用接口的一般规律和具体实例。
一个子类通常添加自己的实例变量和自己的实例方法,因此子类通常比父类大。
一个子类比它的父类更具体并且代表一组更小、更专业的对象。
通过单一继承,子类在开始时拥有父类的所有特性。
继承性真正的力量在于它可以在定义子类时增加或取代从超类中继承来的特征。
java中英文对照
abstra ct 抽象的抽象的abs tract ion 抽象体、抽象物、抽象性抽象体、抽象物、抽象性a ccess存取、取用存取、访问a ccess leve l 存取级别访问级别ac cessfunct ion 存取函式访问函数activ ate 活化激活acti ve 作用中的a dapte r 配接器适配器addr ess 位址地址addr ess s pace位址空间,定址空间addr ess-o f ope rator取址运算子取地址操作符aggre gatio n 聚合algo rithm演算法算法a lloca te 配置分配alloc ator(空间)配置器分配器ap plica tion应用程式应用、应用程序a pplic ation fram ework应用程式框架、应用框架应用程序框架arch itect ure 架构、系统架构体系结构ar gumen t 引数(传给函式的值)。
叁见 para meter叁数、实质叁数、实叁、自变量arr ay 阵列数组arrow oper atorarrow(箭头)运算子箭头操作符assem bly 装配件a ssemb ly la nguag e 组合语言汇编语言as sert(ion)断言a ssign指派、指定、设值、赋值赋值ass ignme nt 指派、指定赋值、分配assi gnmen t ope rator指派(赋值)运算子 = 赋值操作符assoc iated相应的、相关的相关的、关联、相应的asso ciati ve co ntain er 关联式容器(对应 seq uenti al co ntain er)关联式容器atom ic 不可分割的原子的a ttrib ute 属性属性、特性a udio音讯音频A.I. 人工智慧人工智能ba ckgro und 背景背景(用於图形着色)後台(用於行程)b ackwa rd co mpati ble 回溯相容向下兼容bandw idth频宽带宽bas e cla ss 基础类别基类bas e typ e 基础型别 (等同於 bas e cla ss) batch批次(意思是整批作业)批处理be nefit利益收益be st vi ablefunct ion 最佳可行函式最佳可行函式(从 via ble f uncti ons 中挑出的最佳吻合者)bina ry se arch二分搜寻法二分查找bin ary t ree 二元树二叉树bi naryfunct ion 二元函式双叁函数binar y ope rator二元运算子二元操作符b indin g 系结绑定b it 位元位b it fi eld 位元栏位域bit map 位元图位图bit wise以 bit为单元逐一┅b itwis e cop y 以b it 为单元进行复制;位元逐一复制位拷贝bl ock 区块,区段块、区块、语句块boole an 布林值(真假值,true或 fa lse)布尔值borde r 边框、框线边框bra ce(cu rly b race)大括弧、大括号花括弧、花括号br acket(squa re br akcet) 中括弧、中括号方括弧、方括号b reakp oint中断点断点bu ild 建造、构筑、建置(MS用语)buil d-in内建内置bus汇流排总线b usine ss 商务,业务业务bu ttons按钮按钮by te 位元组(由8 bits组成)字节c ache快取高速缓存c all 呼叫、叫用调用c allba ck 回呼回调callopera tor c all(函式呼叫)运算子调用操作符(同 fun ction call oper ator)can didat e fun ction候选函式候选函数(在函式多载决议程序中出现的候选函式)ch ain 串链(例c hainof fu nctio n cal ls)链cha racte r 字元字符check box核取方块(i.e. chec k but ton)复选框check ed ex cepti on 可控式异常(J ava)chec k but ton 方钮 (i.e. ch eck b ox) 复选按钮child clas s 子类别(或称为d erive d cla ss, s ubtyp e)子类cla ss 类别类c lassbody类别本体类体c lassdecla ratio n 类别宣告、类别宣告式类声明cl ass d efini tion类别定义、类别定义式类定义clas s der ivati on li st 类别衍化列类继承列表clas s hea d 类别表头类头clas s hie rarch y 类别继承体系,类别阶层类层次体系cla ss li brary类别程式库、类别库类库class temp late类别模板、类别范本类模板class temp lateparti al sp ecial izati ons 类别模板偏特化类模板部分特化cla ss te mplat e spe ciali zatio ns类别模板特化类模板特化cl eanup清理、善後清理、清除c lient客端、客户端、客户客户clien t-ser ver 主从架构客户/服务器cli pboar d 剪贴簿剪贴板clon e 复制克隆c ollec tion群集集合com bo bo x 复合方块、复合框组合框comm and l ine 命令列命令行(系统文字模式下的整行执行命令)comm unica tion通讯通讯com patib le 相容兼容compi le ti me 编译期编译期、编译时comp iler编译器编译器c ompon ent 组件组件comp ositi on 复合、合成、组合组合comp uter电脑、计算机计算机、电脑conce pt 概念概念concr ete 具象的实在的co ncurr ent 并行并发conf igura tion组态配置con necti on 连接,连线(网络,资料库)连接cons train t 约束(条件)const ruct构件构件con taine r 容器容器(存放资料的某种结构如 list, vec tor...)c ontai nment内含包容co ntext背景关系、周遭环境、上下脉络环境、上下文c ontro l 控制元件、控件控件c onsol e 主控台控制台cons t 常数(const ant 的缩写,C++ 关键字)co nstan t 常数(相对於v ariab le)常量co nstru ctor(ctor)建构式构造函数(与cl ass 同名的一种membe r fun ction s)c opy (v) 复制、拷贝拷贝co py (n) 复件,副本cover涵盖覆盖cr eate创建、建立、产生、生成创建crea tion产生、生成创建curso r 游标光标c ustom订制、自定定制data资料数据da tabas e 资料库数据库data baseschem a 数据库结构纲目data memb er 资料成员、成员变数数据成员、成员变量d ata s truct ure 资料结构数据结构datag ram 资料元数据报文d ead l ock 死结死锁debu g 除错调试d ebugg er 除错器调试器dec larat ion 宣告、宣告式声明deduc tion推导(例:templ ate a rgume nt de ducti on)推导、推断defa ult 预设缺省、默认d efer延缓推迟def ine 定义预定义defi nitio n 定义、定义区、定义式定义del egate委派、委托、委任委托d elega tion(同上)dema rshal反编列散集d erefe rence提领(取出指标所指物体的内容)解叁考der efere nce o perat or de refer ence(提领)运算子 * 解叁考操作符der ivedclass衍生类别派生类desi gn by cont ract契约式设计des ign p atter n 设计范式、设计样式设计模式※最近我比较喜欢「设计范式」一词des troy摧毁、销毁des truct or 解构式析构函数de vice装置、设备设备dialo g 对话窗、对话盒对话框direc tive指令(例:using dire ctive) (编译)指示符dire ctory目录目录di sk 碟盘di spatc h 分派分派d istri buted comp uting分布式计算 (分布式电算)分布式计算分散式计算 (分散式电算)doc ument文件文档do t ope rator dot(句点)运算子 . (圆)点操作符dr iver驱动程式驱动(程序)dy namic bind ing 动态系结动态绑定effic iency效率效率ef ficie nt 高效高效end u ser 终端用户entit y 物体实体、物体enc apsul ation封装封装en closi ng cl ass 外围类别(与巢状类别neste d cla ss 有关)外围类enum (enu merat ion)列举(一种 C++资料型别)枚举enume rator s 列举元(enum型别中的成员)枚举成员、枚举器e qual相等相等equ ality相等性相等性equal ity o perat or eq ualit y(等号)运算子== 等号操作符e quiva lence等价性、等同性、对等性等价性eq uival ent 等价、等同、对等等价esc ape c ode 转义码转义码ev aluat e 评估、求值、核定评估event事件事件e ventdrive n 事件驱动的事件驱动的excep tion异常情况异常e xcept ion d eclar ation异常宣告(ref. C++Prime r 3/e, 11.3)异常声明e xcept ion h andli ng 异常处理、异常处理机制异常处理、异常处理机制ex cepti on sp ecifi catio n 异常规格(ref. C++ Prim er 3/e, 11.4)异常规范exit退离(指离开函式时的那一个执行点)退出exp licit明白的、明显的、显式显式expo rt 汇出引出、导出ex press ion 运算式、算式表达式faci lity设施、设备设施、设备fe ature特性field栏位,资料栏(Ja va)字段, 值域(Java)fi le 档案文件firmw are 韧体固件flag旗标标记fl ash m emory快闪记忆体闪存flex ibili ty 弹性灵活性flus h 清理、扫清刷新fon t 字型字体f orm 表单(pro gramm ing 用语)窗体for mal p arame ter 形式叁数形式叁数forwa rd de clara tion前置宣告前置声明forw ardin g 转呼叫,转发转发fo rward ing f uncti on 转呼叫函式,转发函式转发函数fract al 碎形分形frame work框架框架ful l spe ciali zatio n 全特化(ref. part ial s pecia lizat ion)func tion函式、函数函数funct ion c all o perat or 同callopera tor funct ion o bject函式物件(ref. C++Prime r 3/e, 12.3)函数对象f uncti on ov erloa ded r esolu tion函式多载决议程序函数重载解决(方案)fun ction ality功能、机能功能func tiontempl ate 函式模板、函式范本函数模板funct or 仿函式仿函式、函子game游戏游戏gen erate生成gener ic 泛型、一般化的一般化的、通用的、泛化g eneri c alg orith m 泛型演算法通用算法g etter (相对於 sett er) 取值函式globa l 全域的(对应於local)全局的glo bal o bject全域物件全局对象glo bal s coperesol ution oper ator全域生存空间(范围决议)运算子 ::全局范围解析操作符grou p 群组grou p box群组方块分组框guar d cla use 卫述句 (R efact oring, p250) 卫语句GU I 图形介面图形界面ha nd sh aking握手协商han dle 识别码、识别号、号码牌、权柄句柄ha ndler处理常式处理函数har d-cod ed 编死的硬编码的ha rd-co py 硬拷图屏幕截图ha rd di sk 硬碟硬盘hardw are 硬体硬件hash tabl e 杂凑表哈希表、散列表heade r fil e 表头档、标头档头文件heap堆积堆hier archy阶层体系层次结构(体系)hook挂钩钩子hy perli nk 超链结超链接ico n 图示、图标图标IDE整合开发环境集成开发环境iden tifie r 识别字、识别符号标识符if a nd on ly if若且唯若当且仅当Ill inois伊利诺伊利诺斯imag e 影像图象i mmedi ate b ase 直接的(紧临的)上层baseclass。
JAVA编程中常用的英文单词词汇汇总
Java基础常见英语词汇(共70个)OO: object-oriented ,面向对象OOP: object-oriented programming,面向对象编程JDK:Java development kit, java开发工具包JVM:java virtual machine ,java虚拟机Compile:编绎Run:运行Class:类Object:对象System:系统out:输出print:打印line:行variable:变量type:类型operation:操作,运算array:数组parameter:参数method:方法function:函数member-variable:成员变量member-function:成员函数get:得到set:设置public:公有的private:私有的protected:受保护的default:默认access:访问package:包import:导入static:静态的void:无(返回类型)extends:继承parent class:父类base class:基类super class:超类child class:子类derived class:派生类override:重写,覆盖overload:重载final:最终的,不能改变的abstract:抽象interface:接口implements:实现exception:异常Runtime:运行时ArithmeticException:算术异常ArrayIndexOutOfBoundsException:数组下标越界异常NullPointerException:空引用异常ClassNotFoundException:类没有发现异常NumberFormatException:数字格式异常(字符串不能转化为数字) Try:尝试Catch:捕捉Finally:最后Throw:抛出Throws: (投掷)表示强制异常处理Throwable:(可抛出的)表示所有异常类的祖先类Lang:language,语言Util:工具 Display:显示Random:随机Collection:集合ArrayList:(数组列表)表示动态数组HashMap: 散列表,哈希表Swing:轻巧的 Awt:abstract window toolkit:抽象窗口工具包Frame:窗体Size:尺寸Title:标题Add:添加Panel:面板Layout:布局Scroll:滚动Vertical:垂直Horizonatal:水平Label:标签TextField:文本框TextArea:文本域Button:按钮Checkbox:复选框Radiobutton:单选按钮Combobox:复选框 Event:事件Mouse:鼠标Key:键Focus:焦点Listener:监听Border:边界Flow:流Grid:网格MenuBar:菜单栏Menu:菜单MenuItem:菜单项PopupMenu:弹出菜单Dialog:对话框Message:消息 Icon:图标Tree:树Node:节点Jdbc:java database connectivity,java数据库连接DriverManager:驱动管理器Connection:连接Statement:表示执行对象Preparedstatement:表示预执行对象Resultset:结果集Next:下一个Close:关闭executeQuery:执行查询Jbuilder中常用英文(共33个)File:文件New:新建New Project:新建项目New Class: 新建类New File:新建文件Open project:打开项目Open file:打开文件Reopen:重新打开Close projects:关闭项目Close all except…:除了..全部关闭Rename:重命名Exit:退出View:视图Panes:面板组Project:项目Content:内容Structure:结构Message:消息 Source:源文件Bean:豆子Properties:属性Make:编绎Build:编绎Rebuild:重编绎Refresh:刷新Project properties:项目属性Default project properties:默认的项目属性Run:运行Debug:调试Tools:工具Preferences:参数配置Configure:配置Libraries:库JSP中常用英文URL: Universal Resource Location:统一资源定位符IE: Internet Explorer 因特网浏览器JSP:java server page.java服务器页面Model:模型View:视图C:controller:控制器Tomcat:一种jsp的web服务器WebModule:web模块Servlet:小服务程序Request:请求Response:响应Init: initialize,初始化Service:服务Destroy:销毁Startup:启动Mapping:映射pattern:模式Getparameter:获取参数Session:会话Application:应用程序Context:上下文redirect:重定向dispatch:分发forward:转交setAttribute:设置属性getAttribute:获取属性page:页面contentType:内容类型charset:字符集include:包含tag:标签taglib:标签库EL:expression language,表达式语言Scope:作用域Empty:空JSTL:java standard tag library,java标准标签库TLD:taglib description,标签库描述符Core:核心Test:测试Foreach:表示循环Var:variable,变量Status:状态Items:项目集合Fmt:format,格式化Filter:过滤器报错英文第一章:JDK(Java Development Kit) java开发工具包JVM(Java Virtual Machine) java虚拟机Javac编译命令java解释命令Javadoc生成java文档命令classpath 类路径Version版本author作者public公共的class类static静态的void没有返回值String字符串类System系统类out输出print同行打印println换行打印JIT(just-in-time)及时处理第二章:byte 字节char 字符boolean 布尔short 短整型int 整形long 长整形float 浮点类型double 双精度if 如果else 否则switch 多路分支case 与常值匹配break 终止default 默认while 当到循环do 直到循环for 已知次数循环continue结束本次循环进行下次跌代length 获取数组元素个数第三章:OOPobject oriented programming 面向对象编程Object 对象Class 类Class member 类成员Class method类方法Class variable 类变量Constructor 构造方法Package 包Import package 导入包第四章:Extends 继承Base class 基类Super class 超类Overloaded method 重载方法Overridden method 重写方法Public 公有Private 私有Protected 保护Static 静态Abstract抽象Interface 接口Implements interface 实现接口第五章:Exception 意外,异常RuntimeExcepiton 运行时异常ArithmeticException 算术异常IllegalArgumentException 非法数据异常ArrayIndexOutOfBoundsException 数组索引越界异常NullPointerException 空指针异常ClassNotFoundException 类无法加载异常(类不能找到)NumberFormatException 字符串到float类型转换异常(数字格式异常)IOException 输入输出异常找不到文件异常EOFException 文件结束异常InterruptedException (线程)中断异常try 尝试catch 捕捉finally 最后throw 投、掷、抛throws 投、掷、抛print Stack Trace() 打印堆栈信息get Message()获得错误消息get Cause()获得异常原因method 方法able 能够instance 实例check 检查第六章:byte(字节)char(字符)int(整型)long(长整型)float(浮点型)double(双精度)boolean(布尔)short(短整型)Byte (字节类)Character (字符类)Integer(整型类)Long (长整型类)Float(浮点型类)Double (双精度类)Boolean(布尔类)Short (短整型类)Digit (数字)Letter (字母)Lower (小写)Upper (大写)Space (空格) Identifier (标识符) Start (开始)String (字符串) length (值)equals (等于)Ignore (忽略)compare (比较)sub (提取)concat (连接)replace (替换)trim (整理)Buffer (缓冲器) reverse (颠倒)delete (删除)append (添加)Interrupted (中断的)第七章:Date 日期,日子After 后来,后面Before 在前,以前Equals 相等,均等toString 转换为字符串SetTime 设置时间Display 显示,展示Calendar 日历Add 添加,增加GetInstance获得实例getTime 获得时间Clear 扫除,清除Clone 克隆,复制Util 工具,龙套Components成分,组成Month 月份Year 年,年岁Hour 小时,钟头Minute 分钟Second 秒Random 随意,任意Next Int 下一个整数Gaussian 高斯ArrayList 对列LinkedList链表Hash 无用信息,杂乱信号Map 地图Vector 向量,矢量Size 大小Collection收集Shuffle 混乱,洗牌RemoveFirst移动至开头RemoveLast 移动至最后lastElement最后的元素Capacity 容量,生产量Contains 包含,容纳Copy 副本,拷贝Search 搜索,查询InsertElementAt 插入元素在某一位置第八章:io->in out 输入/输出File文件import导入exists存在isFile是文件isDirectory 是目录getName获取名字getPath获取路径getAbsolutePath 获取绝对路径lastModified 最后修改日期length长度InputStream 输入流OutputStream 输出流Unicode统一的字符编码标准, 采用双字节对字符进行编码Information 信息文件输入流文件输出流IOException 输入输出异常文件对象available 可获取的read读取write写BufferedReader 缓冲区读取文本文件读取BufferedWriter 缓冲区输出文本文件写出flush清空close关闭DataInputStream 二进制文件读取DataOutputStream二进制文件写出EOF最后encoding编码Remote远程release释放第九章:JBuiderJava 集成开发环境(IDE)Enterprise 企业版Developer 开发版Foundation 基础版Messages 消息格Structure 结构窗格Project工程Files文件Source源代码Design设计History历史Doc文档File文件Edit编辑Search查找Refactor 要素View视图Run运行Tools工具Window窗口Help帮助Vector矢量addElement 添加内容Project Winzard 工程向导Step步骤Title标题Description 描述Copyright 版权Company公司Aptech Limited Aptech有限公司author 作者Back后退Finish完成version版本Debug调试New新建ErrorInsight 调试第十章:JFrame窗口框架JPanel 面板JScrollPane 滚动面板title 标题Dimension 尺寸Component组件SwingJA V A轻量级组件getContentPane 得到内容面板LayoutManager布局管理器setVerticalScrollBarPolicy设置垂直滚动条策略AWT(Abstract Window Toolkit)抽象窗口工具包GUI (Graphical User Interface)图形用户界面VERTICAL_SCROLLEARAS_NEEDED当内容大大面板出现滚动条VERTICAL_SOROLLEARAS_ALWAYS显示滚动条VERTICAL_SOROLLEARAS_NEVER不显示滚动条JLabel标签Icon 图标image图象LEFT 左对齐RIGHT右对齐JTextField单行文本getColumns得到列数setLayout设置布局BorderLayout 边框布局CENTER居中对齐JTextArea多行文本setFont设置字体setHorizontalAlignment设置文本水平对齐方式setDefaultCloseOperation设置默认的关闭操作add增加JButton 按钮JCheckBox 复选框JRadioButton单选按钮addItem 增加列表项getItemAt 得到位置的列表项getItemCount 得到列表项个数setRolloverIcon 当鼠标经过的图标setSelectedIcon 当选择按钮的图标getSelectedItem 得到选择的列表项getSelectedIndex 得到选择的索引ActionListener按钮监听ActionEvent 按钮事件actionPerformed按钮单击方法附加.............可能有重复编程英语:(手摘)abstract (关键字) 抽象['?bstr?kt]accessvt.访问,存取['?kses]'(n.入口,使用权)algorithmn.算法['?lg?riem]Annotation[java] 代码注释[?n?u'tei??n]anonymousadj.匿名的[?'n?nim?s]'(反义:directly adv.直接地,立即[di'rektli, dai'rektli]) apply v.应用,适用[?'plai]application n.应用,应用程序[,?pli'kei??n]' (application crash 程序崩溃) arbitrarya.任意的['ɑ:bitr?ri]argument n.参数;争论,论据['ɑ:gjum?nt]'(缩写args)assert (关键字) 断言[?'s?:t] ' (java 1.4 之后成为关键字)associaten.关联(同伴,伙伴) [?'s?u?ieit]attributen.属性(品质,特征) [?'tribju:t]boolean(关键字) 逻辑的, 布尔型call n.v.调用; 呼叫; [k?:l]circumstancen.事件(环境,状况) ['s?:k?mst?ns]crash n.崩溃,破碎[kr??]cohesion 内聚,黏聚,结合[k?u'hi:??n](a class is designed with a single, well-focoused purpose. 应该不止这点)command n. 命令,指令[k?'mɑ:nd](指挥, 控制) (command-line 命令行) Comments [java] 文本注释['k?ments]compile[java] v.编译[k?m'pail]' Compilation n.编辑[,k?mpi'lei??n]const (保留字)constant n. 常量, 常数, 恒量['k?nst?nt]continue (关键字)coupling 耦合,联结['k?pli?]making sure that classes know about other classes only through their APIs.declare[java] 声明[di'kl??]default(关键字) 默认值; 缺省值[di'f?:lt]delimiter定义符; 定界符Encapsulation[java] 封装(hiding implementation details)Exception [java] 例外; 异常[ik'sep??n]entry n.登录项, 输入项, 条目['entri]enum(关键字)execute vt.执行['eksikju:t]exhibit v.显示, 陈列[ig'zibit]exist 存在, 发生[ig'zist] '(SQL关键字exists)extends(关键字) 继承、扩展[ik'stend]false (关键字)final (关键字) finally (关键字)fragments段落; 代码块['fr?gm?nt]FrameWork [java] 结构,框架['freimw?:k]Generic[java] 泛型[d?i'nerik]goto(保留字) 跳转heap n.堆[hi:p]implements(关键字) 实现['implim?nt]import (关键字) 引入(进口,输入)Info n.信息(information [,inf?'mei??n] )Inheritance [java] 继承[in'herit?ns] (遗传,遗产)initialize 预置初始化[i'ni??laiz]instanceof(关键字) 运算符,用于引用变量,以检查这个对象是否是某种类型。
Java语言概述与面向对象思想中英文翻译
Java语言概述与面向对象思想Java,是由Sun Microsystems公司于1995年5月推出的Java程序设计语言和Java的总称。
用Java实现的Hot Java 浏览器(支持Java applet)显示了Java的魅力:跨平台、动态的Web、Internet计算。
从此,Java被广泛接受并推动了Web的迅速发展,常用的浏览器现在均支持Java applet。
平台Java平台由Java虚拟机(Java Virtual Machine)和Java 应用编程接口(Application Programming Interface、简称API)构成。
Java 应用编程接口为Java应用提供了一个独立于操作系统的标准接口,可分为基本部分和扩展部分。
在硬件或操作系统平台上安装一个Java平台之后,Java应用程序就可运行。
现在Java平台已经嵌入了几乎所有的操作系统。
这样Java程序可以只编译一次,就可以在各种系统中运行。
Java应用编程接口已经从1.1x版发展到1.2版。
目前常用的Java平台基于Java1.5,最近版本为Java1.7。
Java分为三个体系JavaSE(Java2 Platform Standard Edition,java 平台标准版),JavaEE(Java 2 Platform,Enterprise Edition,java平台企业版),JavaME(Java 2 Platform Micro Edition,java平台微型版)。
Java SEJAVA* Java SE(Java Platform,Standard Edition)。
Java SE 以前称为J2SE。
它允许开发和部署在桌面、服务器、嵌入式环境和实时环境中使用的Java 应用程序。
Java SE 包含了支持Java Web 服务开发的类,并为Java Platform,Enterprise Edition(Java EE)提供基础。
Java的面向对象编程外文资料翻译
Java的面向对象编程外文资料翻译Java是一种面向对象编程语言,它支持类、对象、继承、多态性等面向对象的概念。
面向对象编程是一种程序设计方法,它将程序看作是一组对象的集合,这些对象通过相互交互来完成任务。
在面向对象编程中,每个对象都有自己的状态和行为,并且能够与其他对象进行交互。
继承是面向对象编程的一个重要概念,它允许一个类继承另一个类的属性和方法。
通过继承,子类可以重用父类的代码,并且可以添加自己的属性和方法。
Java中的继承是单一继承,也就是说每个类只能有一个父类。
多态性是另一个重要的面向对象编程概念。
它允许不同的对象对同一个消息做出不同的响应。
在Java中,多态性通过方法的重载和重写来实现。
方法的重载是指在同一个类中定义多个同名但参数不同的方法。
方法的重写是指子类覆盖父类的方法,使得子类对象可以调用父类的方法。
Java的面向对象编程具有很多优点,例如代码重用、可维护性、可扩展性等。
它也有一些缺点,例如性能问题和复杂性问题。
然而,随着计算机硬件和软件技术的不断进步,这些问题已经得到了很好的解决。
因此,Java的面向对象编程仍然是一种非常流行和重要的编程方法。
软件重用是一种节省程序开发时间的方法。
它可以减少系统运行后可能出现的问题,并鼓励重复使用已经调试好的高质量的软件。
这些都是令人振奋的可能性。
多态性是一种强大的技术,它允许我们用统一的风格编写程序,来处理多种已存在的类和特定的相关类。
通过利用多态性,我们可以方便地向系统中添加新的功能。
继承和多态是解决软件复杂性的有效可行的技术。
当创建一个新的类时,程序员可以指定新的类继承已定义的超类的实例变量和实例方法,而不用完整的写出新的实例变量和实例方法。
这个新的类被称为一个子类。
每个子类本身将来亦可有新的子类,而其本身将成为父类。
Java不支持多重继承,但它支持接口的概念。
接口可以使Java实现许多通过多重继承才能实现的优点而没有关联的问题。
在本章中,我们将讨论接口的详细内容,并给出创建和使用接口的一般规律和具体实例。
java中常用英文简写全拼与中文意思
API (Application Programming Interface) 应用编程接口JRE (Java Runtime Enviroment) Java 运行时环境JDK (Java Development Kit) Java开发工具包SDK(Software Development Kit, 即软件开发工具包)JVM (Java Virtual Machine) Java虚拟机JNI (Java Native Interface) Java本地接口AWT (Abstract Windows Toolekit) 抽象窗口工具箱JNDI (Java Naming & Directory Interface) JAVA命名目录服务.主要提供的功能是:提供一个目录系统,让其它各地的应用程序在其上面留下自己的索引,从而满足快速查找和定位分布式应用程序的功能。
JMS (Java Message Service)JAVA消息服务.主要实现各个应用程序之间的通讯.包括点对点和广播.JTA (Java Transcation API) JAVA事务服务.提供各种分布式事务服务.应用程序只需调用其提供的接口即可.JAF (Java Action FrameWork) JAVA安全认证框架.提供一些安全控制方面的框架.让开发者通过各种部署和自定义实现自己的个性安全控制策略.RMI (Remote Method Interface) 远程方法调用CVS (Concurrent Versions System) 版本控制器SVN (Subversion) 版本控制器TC (Test Case) 测试用例,是为某个特殊目标而编制的一组测试输入、执行条件以及预期结果,以便测试某个程序路径或核实是否满足某个特定需求。
指对一项特定的软件产品进行测试任务的描述,体现测试方案、方法、技术和策略。
内容包括测试目标、测试环境、输入数据、测试步骤、预期结果、测试脚本等,并形成文档。
java中英文对照
1 . Introduction To Objects1.1The progress of abstractionAll programming languages provide abstractions. It can be argued that the complexity of the problems you’re able to solve is directly related to the kind and quality of abstraction. By “kind” I mean, “What is it that you are abstracting?” Assembly language is a small abstraction of the underlying machine. Many so-called “imperative” languages that followed (such as FORTRAN, BASIC, and C) were abstractions of assembly language. These languages are big improvements over assembly language, but their primary abstraction still requires you to think in terms of the structure of the computer rather than the structure of the problem you are trying to solve. The programmer must establish the association between the machine model (in the “solution space,” which is the place where you’re modeling that problem, such as a computer) and the model of the problem that is actually being solved (in the “problem space,” which is the place where the problem exists). The effort required to perform this mapping, and the fact that it is extrinsic to the programming language, produces programs that are difficult to write and expensive to maintain, and as a side effect created the entire “programming methods” industry.The alter native to modeling the machine is to model the problem you’re trying to solve. Early languages such as LISP and APL chose particular views of the world (“All problems are ultimately lists” or “All problems are algorithmic,” respectively). PROLOG casts all problems into chains of decisions. Languages have been created for constraint-based programming and for programming exclusively by manipulating graphical symbols. (The latter proved to be too restrictive.) Each of these approaches is a good solution to the particular class of problem they’re designed to solve, but when you step outside of that domain they become awkward.The object-oriented approach goes a step further by providing tools for the programmer to represent elements in the problem space. This representation is general enough that the programmer is not constrained to any particular type of problem. We refer to the elements in the problem space and their representations in the solution space as “objects.” (You will also need other objects that don’t have problem-space analogs.) The idea is that the program is allowed to adapt itself to the lingo of the problem by adding new types of objects, sowhen you read the code describing the solution, you’re reading words that also express the problem. This is a more flexible and powerful language abstraction than what we’ve had before. Thus, OOP allows you to describe the problem in terms of the problem, rather than in terms of the computer where the solution will run. There’s still a connection back to the computer: each object looks quite a bit like a little computer—it has a state, and it has operations that you can ask it to perform. However, this doesn’t seem like such a bad analogy to objects in the real world—they all have characteristics and behaviors.Alan Kay summarized five basic characteristics of Smalltalk, the first successful object-oriented language and one of the languages upon which Java is based. These characteristics represent a pure approach to object-oriented programming:1.Everything is an object.Think of an object as a fancy variable; it stores data, but you can “makerequests” to that object, asking it to perform operations on itself. In theory, you can take any conceptual component in the problem you’re trying to solve (dogs, building s, services, etc.) and represent it as an object in your program.2. A program is a bunch of objects telling each other what to do by sending messages. To make arequest of an object, you “send a message” to that object. More concretely, you can think of a m essage as a request to call a method that belongs to a particular object.3.Each object has its own memory made up of other objects. Put another way, you create a new kindof object by making a package containing existing objects. Thus, you can build complexity into a program while hiding it behind the simplicity of objects.4.Every object has a type. Using the parlance, each object is an instance of a class, in which “class” issynonymous with “type.” The most important distinguishing characteristic of a class is “What messages can you send to it?”5.All objects of a particular type can receive the same messages. This is actually a loaded statement,as you will see later. Because an object of type “circle” is also an object of type “shape,” a circle is guaranteed to accept shape messages. This means you can write code that talks to shapes and automatically handle anything that fits the description of a shape. This substitutability is one of the powerful concepts in OOP.Booch offers an even more succinct description of an object:An object has state, behavior and identity.This means that an object can have internal data (which gives it state), methods (to produce behavior), and each object can be uniquely distinguished from every other object—to put this in a concrete sense, each object has a unique address in memory.1.2 An object has an interfaceAristotle was probably the first to begin a careful study of the concept of type;he spoke of “the class of fishes and the class of birds.” The idea that all objects, while being unique, are also part of a class of objects that have characteristics and behaviors in common was used directly in the first object-oriented language, Simula-67, with its fundamental keyword class that introduces a new type into a program.S imula, as its name implies, was created for developing simulations such as the classic “bank teller problem.” In this, you have a bunch of tellers, customers, accounts, transactions, and units of money—a lot of “objects.” Objects that are identical except for their state during a program’s execution are grouped together into “classes of objects” and that’s where the keyword class came from. Creating abstract data types (classes) is a fundamental concept in object-oriented programming. Abstract data types work almost exactly like built-in types: You can create variables of a type (called objects or instances in object-oriented parlance) and manipulate those variables (called sending messages or requests; you send a message and the object figures out what to do with it). The members (elements) of each class share some commonality: every account has a balance, every teller can accept a deposit, etc. At the same time, each member has its own state: each account has a different balance, each teller has a name. Thus, the tellers, customers, accounts, transactions, etc., can each be represented with a unique entity in the computer program. This entity is the object, and each object belongs to a particular class that defines its characteristics and behaviors.So, although what we really do in object-oriented programming is create new data types, virtually all object-oriented programming languages use the “class” keyword. When you see the word “type” think “class” and vice versa.Since a class describes a set of objects that have identical characteristics (data elements) and behaviors (functionality), a class is really a data type because a floating point number, for example, also has a set ofcharacteristics and behaviors. The difference is that a programmer defines a class to fit a problem rather than being forced to use an existing data type that was designed to represent a unit of storage in a machine. You extend the programming language by adding new data types specific to your needs. The programming system welcomes the new classes and gives them all the care and type-checking that it gives to built-in types.The object-oriented approach is not limited to building simulations. Whether or not you agree that any program is a simulation of the system you’re designing, the use of OOP techniques can easily reduce a large set of problems to a simple solution.Once a class is established, you can make as many objects of that class as you like, and then manipulate those objects as if they are the elements that exist in the problem you are trying to solve. Indeed, one of the challenges of object-oriented programming is to create a one-to-one mapping between the elements in the problem space and objects in the solution space.But how do you get an object to do useful work for you? There must be a way to make a request of the object so that it will do something, such as complete a transaction, draw something on the screen, or turn on a switch. And each object can satisfy only certain requests. The requests you can make of an object are defined by its interface, and the type is what determines the interface. A simple example might be a representation of a light bulb:Light lt = new Light();lt.on();The interface establishes what requests you can make for a particular object. However, there must be code somewhere to satisfy that request. This, along with the hidden data, comprises the implementation. From a procedural programming standpoint, it’s not that complicated. A type has a method associated with each possible request, and when you make a particular request to an object, that method is called. This process isusually summarized by saying that you “send a message” (make a request) to an object, and the object figures out what to do with that message (it executes code).Here, the name of the type/class is Light, the name of this particular Light object is lt,and the requests that you can make of a Light object are to turn it on, turn it off, make it brighter, or make it dimmer. You create a Light object by defining a “reference” (lt) for that object and calling new to request a new object of that type. To send a message to the object, you state the name of the object and connect it to the message request with a period (dot). From the standpoint of the user of a predefined class, that’s pretty much all there is to programming with objects.The preceding diagram follows the format of the Unified Modeling Language(UML). Each class is represented by a box, with the type name in the top portion of the box, any data members that you care to describe in the middle portion of the box, and the methods(the functions that belong to this object, which receive any messages you send to that object) in the bottom portion of the box. Often, only the name of the class and the public methods are shown in UML design diagrams, so the middle portion is not shown. If you’re interested only in the class name, then the bottom portion doesn’t need to be shown, either1.3 An object provides services.While you’re trying to develop or understand a program design, one of the best ways to think about objects is as “service providers.” Your program itself will provide services to the user, and it will accomplish this by using the services offered by other objects. Your goal is to produce (or even better, locate in existing code libraries) a set of objects that provide the ideal services to solve your problem.A way to start doing this is to ask “if I could magically pull them out of a hat, what objects would solve my problem right away?” For example, suppose you are creating a bookkeeping program. You might imagine some objects that contain pre-defined bookkeeping input screens, another set of objects that perform bookkeeping calculations, and an object that handles printing of checks and invoices on all different kinds of printers. Maybe some of these objects alread y exist, and for the ones that don’t, what would they look like? What services would those objects provide, and what objects would they need to fulfill their obligations? If you keep doing this, you will eventually reach a point where you can say either “t hat object seems simpleenough to sit down and write” or “I’m sure that object must exist already.” This is a reasonable way to decompose a problem into a set of objects.Thinking of an object as a service provider has an additional benefit: it helps to improve the cohesiveness of the object. High cohesion is a fundamental quality of software design: It means that the various aspects of a software component (such as an object, although this could also apply to a method or a library of objects) “fit togethe r” well. One problem people have when designing objects is cramming too much functionality into one object. For example, in your check printing module, you may decide you need an object that knows all about formatting and printing. You’ll probably discover that this is too much for one object, and that what you need is three or more objects. One object might be a catalog of all the possible check layouts, which can be queried for information about how to print a check. One object or set of objects could be a generic printing interface that knows all about different kinds of printers (but nothing about bookkeeping—this one is a candidate for buying rather than writing yourself). And a third object could use the services of the other two to accomplish the task. Thus, each object has a cohesive set of services it offers. In a good object-oriented design, each object does one thing well, but doesn’t try to do too much. As seen here, this not only allows the discovery of objects that might be purchased (the printer interface object), but it also produces the possibility of an object that might be reused somewhere else (the catalog of check layouts).Treating objects as service providers is a great simplifying tool, and it’s very useful not only during the design process, but also when someone else is trying to understand your code or reuse an object—if they can see the value of the object based on what service it provides, it makes it much easier to fit it into the design.1. 对象入门1.1 抽象的进步所有编程语言的最终目的都是提供一种“抽象”方法。
Java编程基础常见英语词汇
Java编程基础常见英语词汇学编程英语基础要好,下面店铺整理了Java编程基础常见英语词汇,希望对大家有帮助!OO:object-oriented ,面向对象OOP: object-oriented programming,面向对象编程JDK:Java development kit, 开发工具包JVM:java virtual machine ,java虚拟机Compile:编绎 Run:运行 Class:类 Object:对象System:系统 out:输出 print:打印 line:行variable:变量 type:类型 array:数组 parameter:参数method:方法 function:函数 get:得到 set:设置member-variable:成员变量 member-function:成员函数operation:操作,运算 void:无(返回类型) static:静态的public:公有的 private:私有的 protected:受保护的default:默认 access:访问 package:包 import:导入extends:继承 parent class:父类 base class:基类 super class:超类child class:子类 derived class:派生类 override:重写,覆盖overload:重载 interface:接口 exception:异常final:最终的,不能改变的abstract:抽象implements:实现Runtime:运行时ArithmeticException:算术异常ArrayIndexOutOfBoundsException:数组下标越界异常NullPointerException:空引用异常ClassNotFoundException:类没有发现异常NumberFormatException:数字格式异常(字符串不能转化为数字) Try:尝试 Catch:捕捉 Finally:最后 Throw:抛出Throws: (投掷)表示强制异常处理Throwable:(可抛出的)表示所有异常类的祖先类Lang:language,语言 Util:工具 Display:显示 Random:随机Collection:集合 ArrayList:(数组列表)表示动态数组HashMap: 散列表,哈希表 Radiobutton:单选按钮Swing:轻巧的 Awt:abstract window toolkit:抽象窗口工具包Frame:窗体 Size:尺寸 Title:标题 Add:添加 Tree:树 Node:节点Panel:面板 Layout:布局 Scroll:滚动 Vertical:垂直 Horizonatal:水平TextField:文本框 TextArea:文本域 Checkbox:复选框Button:按钮 Label:标签 Mouse:鼠标 Icon:图标 Message:消息Combobox:复选框 Event:事件 Key:键 Focus:焦点 Listener:监听Border:边界 Flow:流 Grid:网格 MenuBar:菜单栏 Menu:菜单MenuItem:菜单项 PopupMenu:弹出菜单 Dialog:对话框Jdbc:java database connectivity,java数据库连接DriverManager:驱动管理器 Connection:连接 Resultset:结果集Statement:表示执行对象 Preparedstatement:表示预执行对象Next:下一个 Close:关闭 executeQuery:执行查询。
JAVA编程术语英语翻译
**********************<JA V A编程术语英语翻译>**********************abstract 抽象的抽象的abstraction 抽象体、抽象物、抽象性抽象体、抽象物、抽象性access 存取、取用存取、访问access level 存取级别访问级别access function 存取函式访问函数activate 活化激活active 作用中的adapter 配接器适配器address 位址地址address space 位址空间,定址空间address-of operator 取址运算子取地址操作符aggregation 聚合algorithm 演算法算法allocate 配置分配allocator (空间)配置器分配器application 应用程式应用、应用程序application framework 应用程式框架、应用框架应用程序框架architecture 架构、系统架构体系结构argument 引数(传给函式的值)。
叁见parameter 叁数、实质叁数、实叁、自变量array 阵列数组arrow operator arrow(箭头)运算子箭头操作符assembly 装配件assembly language 组合语言汇编语言assert(ion) 断言assign 指派、指定、设值、赋值赋值assignment 指派、指定赋值、分配assignment operator 指派(赋值)运算子= 赋值操作符associated 相应的、相关的相关的、关联、相应的associative container 关联式容器(对应sequential container)关联式容器atomic 不可分割的原子的attribute 属性属性、特性audio 音讯音频A.I. 人工智慧人工智能background 背景背景(用於图形着色)後台(用於行程)backward compatible 回溯相容向下兼容bandwidth 频宽带宽base class 基础类别基类base type 基础型别(等同於base class)batch 批次(意思是整批作业)批处理benefit 利益收益best viable function 最佳可行函式最佳可行函式(从viable functions 中挑出的最佳吻合者)binary search 二分搜寻法二分查找binary tree 二元树二叉树binary function 二元函式双叁函数binary operator 二元运算子二元操作符binding 系结绑定bit 位元位bit field 位元栏位域bitmap 位元图位图bitwise 以bit 为单元逐一┅bitwise copy 以bit 为单元进行复制;位元逐一复制位拷贝block 区块,区段块、区块、语句块boolean 布林值(真假值,true 或false)布尔值border 边框、框线边框brace(curly brace) 大括弧、大括号花括弧、花括号bracket(square brakcet) 中括弧、中括号方括弧、方括号breakpoint 中断点断点build 建造、构筑、建置(MS 用语)build-in 内建内置bus 汇流排总线business 商务,业务业务buttons 按钮按钮byte 位元组(由8 bits 组成)字节cache 快取高速缓存call 呼叫、叫用调用callback 回呼回调call operator call(函式呼叫)运算子调用操作符(同function call operator)candidate function 候选函式候选函数(在函式多载决议程序中出现的候选函式)chain 串链(例chain of function calls)链character 字元字符check box 核取方块(i.e. check button) 复选框checked exception 可控式异常(Java)check button 方钮(i.e. check box) 复选按钮child class 子类别(或称为derived class, subtype)子类class 类别类class body 类别本体类体class declaration 类别宣告、类别宣告式类声明class definition 类别定义、类别定义式类定义class derivation list 类别衍化列类继承列表class head 类别表头类头class hierarchy 类别继承体系, 类别阶层类层次体系class library 类别程式库、类别库类库class template 类别模板、类别范本类模板class template partial specializations类别模板偏特化类模板部分特化class template specializations类别模板特化类模板特化cleanup 清理、善後清理、清除client 客端、客户端、客户客户client-server 主从架构客户/服务器clipboard 剪贴簿剪贴板clone 复制克隆collection 群集集合combo box 复合方块、复合框组合框command line 命令列命令行(系统文字模式下的整行执行命令)communication 通讯通讯compatible 相容兼容compile time 编译期编译期、编译时compiler 编译器编译器component 组件组件composition 复合、合成、组合组合computer 电脑、计算机计算机、电脑concept 概念概念concrete 具象的实在的concurrent 并行并发configuration 组态配置connection 连接,连线(网络,资料库)连接constraint 约束(条件)construct 构件构件container 容器容器(存放资料的某种结构如list, vector...)containment 内含包容context 背景关系、周遭环境、上下脉络环境、上下文control 控制元件、控件控件console 主控台控制台const 常数(constant 的缩写,C++ 关键字)constant 常数(相对於variable)常量constructor(ctor)建构式构造函数(与class 同名的一种member functions)copy (v) 复制、拷贝拷贝copy (n) 复件, 副本cover 涵盖覆盖create 创建、建立、产生、生成创建creation 产生、生成创建cursor 游标光标custom 订制、自定定制data 资料数据database 资料库数据库database schema 数据库结构纲目data member 资料成员、成员变数数据成员、成员变量data structure 资料结构数据结构datagram 资料元数据报文dead lock 死结死锁debug 除错调试debugger 除错器调试器declaration 宣告、宣告式声明deduction 推导(例:template argument deduction)推导、推断default 预设缺省、默认defer 延缓推迟define 定义预定义definition 定义、定义区、定义式定义delegate 委派、委托、委任委托delegation (同上)demarshal 反编列散集dereference 提领(取出指标所指物体的内容)解叁考dereference operator dereference(提领)运算子* 解叁考操作符derived class 衍生类别派生类design by contract 契约式设计design pattern 设计范式、设计样式设计模式※最近我比较喜欢「设计范式」一词destroy 摧毁、销毁destructor 解构式析构函数device 装置、设备设备dialog 对话窗、对话盒对话框directive 指令(例:using directive)(编译)指示符directory 目录目录disk 碟盘dispatch 分派分派distributed computing 分布式计算(分布式电算) 分布式计算分散式计算(分散式电算)document 文件文档dot operator dot(句点)运算子. (圆)点操作符driver 驱动程式驱动(程序)dynamic binding 动态系结动态绑定efficiency 效率效率efficient 高效高效end user 终端用户entity 物体实体、物体encapsulation 封装封装enclosing class 外围类别(与巢状类别nested class 有关)外围类enum (enumeration) 列举(一种C++ 资料型别)枚举enumerators 列举元(enum 型别中的成员)枚举成员、枚举器equal 相等相等equality 相等性相等性equality operator equality(等号)运算子== 等号操作符equivalence 等价性、等同性、对等性等价性equivalent 等价、等同、对等等价escape code 转义码转义码evaluate 评估、求值、核定评估event 事件事件event driven 事件驱动的事件驱动的exception 异常情况异常exception declaration 异常宣告(ref. C++ Primer 3/e, 11.3)异常声明exception handling 异常处理、异常处理机制异常处理、异常处理机制exception specification 异常规格(ref. C++ Primer 3/e, 11.4)异常规范exit 退离(指离开函式时的那一个执行点)退出explicit 明白的、明显的、显式显式export 汇出引出、导出expression 运算式、算式表达式facility 设施、设备设施、设备feature 特性field 栏位,资料栏(Java)字段, 值域(Java)file 档案文件firmware 韧体固件flag 旗标标记flash memory 快闪记忆体闪存flexibility 弹性灵活性flush 清理、扫清刷新font 字型字体form 表单(programming 用语)窗体formal parameter 形式叁数形式叁数forward declaration 前置宣告前置声明forwarding 转呼叫,转发转发forwarding function 转呼叫函式,转发函式转发函数fractal 碎形分形framework 框架框架full specialization 全特化(ref. partial specialization)function 函式、函数函数function call operator 同call operatorfunction object 函式物件(ref. C++ Primer 3/e, 12.3)函数对象function overloaded resolution函式多载决议程序函数重载解决(方案)functionality 功能、机能功能function template 函式模板、函式范本函数模板functor 仿函式仿函式、函子game 游戏游戏generate 生成generic 泛型、一般化的一般化的、通用的、泛化generic algorithm 泛型演算法通用算法getter (相对於setter) 取值函式global 全域的(对应於local)全局的global object 全域物件全局对象global scope resolution operator全域生存空间(范围决议)运算子:: 全局范围解析操作符group 群组group box 群组方块分组框guard clause 卫述句(Refactoring, p250) 卫语句GUI 图形介面图形界面hand shaking 握手协商handle 识别码、识别号、号码牌、权柄句柄handler 处理常式处理函数hard-coded 编死的硬编码的hard-copy 硬拷图屏幕截图hard disk 硬碟硬盘hardware 硬体硬件hash table 杂凑表哈希表、散列表header file 表头档、标头档头文件heap 堆积堆hierarchy 阶层体系层次结构(体系)hook 挂钩钩子hyperlink 超链结超链接icon 图示、图标图标IDE 整合开发环境集成开发环境identifier 识别字、识别符号标识符if and only if 若且唯若当且仅当Illinois 伊利诺伊利诺斯image 影像图象immediate base 直接的(紧临的)上层base class。
java编程思想的翻译
JAVA编程思想第2章一切都是对象尽管以C++为基础,但Java是一种更纯粹的面向对象程序设计语言”。
无论C++还是Java都属于杂合语言。
但在Java中,设计者觉得这种杂合并不象在C++里那么重要。
杂合语言允许采用多种编程风格;之所以说C++是一种杂合语言,是因为它支持与C语言的向后兼容能力。
由于C++是C的一个超集,所以包含的许多特性都是后者不具备的,这些特性使C++在某些地方显得过于复杂。
Java语言首先便假定了我们只希望进行面向对象的程序设计。
也就是说,正式用它设计之前,必须先将自己的思想转入一个面向对象的世界(除非早已习惯了这个世界的思维方式)。
只有做好这个准备工作,与其他OOP语言相比,才能体会到Java的易学易用。
第6章类再生“Java引人注目的一项特性是代码的重复使用或者再生。
但最具革命意义的是,除代码的复制和修改以外,我们还能做多得多的其他事情。
”在象C那样的程序化语言里,代码的重复使用早已可行,但效果不是特别显著。
与Java 的其他地方一样,这个方案解决的也是与类有关的问题。
我们通过创建新类来重复使用代码,但却用不着重新创建,可以直接使用别人已建好并调试好的现成类。
但这样做必须保证不会干扰原有的代码。
在这一章里,我们将介绍两个达到这一目标的方法。
第一个最简单:在新类里简单地创建原有类的对象。
我们把这种方法叫作“合成”,因为新类由现有类的对象合并而成。
我们只是简单地重复利用代码的功能,而不是采用它的形式。
第二种方法则显得稍微有些技巧。
它创建一个新类,将其作为现有类的一个“类型”。
我们可以原样采取现有类的形式,并在其中加入新代码,同时不会对现有的类产生影响。
这种魔术般的行为叫作“继承”(Inheritance),涉及的大多数工作都是由编译器完成的。
对于面向对象的程序设计,“继承”是最重要的基础概念之一。
第14章多线程利用对象,可将一个程序分割成相互独立的区域。
我们通常也需要将一个程序转换成多个独立运行的子任务。
JAVA编程术语英语翻译
**********************<JAVA编程术语英语翻译>**********************abstract 抽象的抽象的abstraction 抽象体、抽象物、抽象性抽象体、抽象物、抽象性access 存取、取用存取、访问access level 存取级别访问级别access function 存取函式访问函数activate 活化激活active 作用中的adapter 配接器适配器address 位址地址address space 位址空间,定址空间address-of operator 取址运算子取地址操作符aggregation 聚合algorithm 演算法算法allocate 配置分配allocator (空间)配置器分配器application 应用程式应用、应用程序application framework 应用程式框架、应用框架应用程序框架architecture 架构、系统架构体系结构argument 引数(传给函式的值)。
叁见 parameter 叁数、实质叁数、实叁、自变量array 阵列数组arrow operator arrow(箭头)运算子箭头操作符assembly 装配件assembly language 组合语言汇编语言assert(ion) 断言assign 指派、指定、设值、赋值赋值assignment 指派、指定赋值、分配assignment operator 指派(赋值)运算子 = 赋值操作符associated 相应的、相关的相关的、关联、相应的associative container 关联式容器(对应sequential container)关联式容器atomic 不可分割的原子的attribute 属性属性、特性audio 音讯音频A.I. 人工智慧人工智能background 背景背景(用於图形着色)後台(用於行程)backward compatible 回溯相容向下兼容bandwidth 频宽带宽base class 基础类别基类base type 基础型别 (等同於 base class)batch 批次(意思是整批作业)批处理benefit 利益收益best viable function 最佳可行函式最佳可行函式(从 viable functions 中挑出的最佳吻合者)binary search 二分搜寻法二分查找binary tree 二元树二叉树binary function 二元函式双叁函数binary operator 二元运算子二元操作符binding 系结绑定bit 位元位bit field 位元栏位域bitmap 位元图位图bitwise 以 bit 为单元逐一┅bitwise copy 以 bit 为单元进行复制;位元逐一复制位拷贝block 区块,区段块、区块、语句块boolean 布林值(真假值,true 或 false)布尔值border 边框、框线边框brace(curly brace) 大括弧、大括号花括弧、花括号bracket(square brakcet) 中括弧、中括号方括弧、方括号breakpoint 中断点断点build 建造、构筑、建置(MS 用语)build-in 内建内置bus 汇流排总线business 商务,业务业务buttons 按钮按钮byte 位元组(由 8 bits 组成)字节cache 快取高速缓存call 呼叫、叫用调用callback 回呼回调call operator call(函式呼叫)运算子调用操作符(同 function call operator)candidate function 候选函式候选函数(在函式多载决议程序中出现的候选函式)chain 串链(例 chain of function calls)链character 字元字符check box 核取方块 (i.e. check button) 复选框checked exception 可控式异常(Java)check button 方钮 (i.e. check box) 复选按钮child class 子类别(或称为derived class, subtype)子类class 类别类class body 类别本体类体class declaration 类别宣告、类别宣告式类声明class definition 类别定义、类别定义式类定义class derivation list 类别衍化列类继承列表class head 类别表头类头class hierarchy 类别继承体系, 类别阶层类层次体系class library 类别程式库、类别库类库class template 类别模板、类别范本类模板class template partial specializations类别模板偏特化类模板部分特化class template specializations类别模板特化类模板特化cleanup 清理、善後清理、清除client 客端、客户端、客户客户client-server 主从架构客户/服务器clipboard 剪贴簿剪贴板clone 复制克隆collection 群集集合combo box 复合方块、复合框组合框command line 命令列命令行(系统文字模式下的整行执行命令)communication 通讯通讯compatible 相容兼容compile time 编译期编译期、编译时compiler 编译器编译器component 组件组件composition 复合、合成、组合组合computer 电脑、计算机计算机、电脑concept 概念概念concrete 具象的实在的concurrent 并行并发configuration 组态配置connection 连接,连线(网络,资料库)连接constraint 约束(条件)construct 构件构件container 容器容器(存放资料的某种结构如 list, vector...)containment 内含包容context 背景关系、周遭环境、上下脉络环境、上下文control 控制元件、控件控件console 主控台控制台const 常数(constant 的缩写,C++ 关键字)constant 常数(相对於 variable)常量constructor(ctor)建构式构造函数(与class 同名的一种 member functions)copy (v) 复制、拷贝拷贝copy (n) 复件, 副本cover 涵盖覆盖create 创建、建立、产生、生成创建creation 产生、生成创建cursor 游标光标custom 订制、自定定制data 资料数据database 资料库数据库database schema 数据库结构纲目data member 资料成员、成员变数数据成员、成员变量data structure 资料结构数据结构datagram 资料元数据报文dead lock 死结死锁debug 除错调试debugger 除错器调试器declaration 宣告、宣告式声明deduction 推导(例:template argument deduction)推导、推断default 预设缺省、默认defer 延缓推迟define 定义预定义definition 定义、定义区、定义式定义delegate 委派、委托、委任委托delegation (同上)demarshal 反编列散集dereference 提领(取出指标所指物体的内容)解叁考dereference operator dereference(提领)运算子 * 解叁考操作符derived class 衍生类别派生类design by contract 契约式设计design pattern 设计范式、设计样式设计模式※最近我比较喜欢「设计范式」一词destroy 摧毁、销毁destructor 解构式析构函数device 装置、设备设备dialog 对话窗、对话盒对话框directive 指令(例:using directive) (编译)指示符directory 目录目录disk 碟盘dispatch 分派分派distributed computing 分布式计算 (分布式电算) 分布式计算分散式计算 (分散式电算)document 文件文档dot operator dot(句点)运算子 . (圆)点操作符driver 驱动程式驱动(程序)dynamic binding 动态系结动态绑定efficiency 效率效率efficient 高效高效end user 终端用户entity 物体实体、物体encapsulation 封装封装enclosing class 外围类别(与巢状类别 nested class 有关)外围类enum (enumeration) 列举(一种 C++ 资料型别)枚举enumerators 列举元(enum 型别中的成员)枚举成员、枚举器equal 相等相等equality 相等性相等性equality operator equality(等号)运算子 == 等号操作符equivalence 等价性、等同性、对等性等价性equivalent 等价、等同、对等等价escape code 转义码转义码evaluate 评估、求值、核定评估event 事件事件event driven 事件驱动的事件驱动的exception 异常情况异常exception declaration 异常宣告(ref. C++ Primer 3/e, 11.3)异常声明exception handling 异常处理、异常处理机制异常处理、异常处理机制exception specification 异常规格(ref. C++ Primer 3/e, 11.4)异常规范exit 退离(指离开函式时的那一个执行点)退出explicit 明白的、明显的、显式显式export 汇出引出、导出expression 运算式、算式表达式facility 设施、设备设施、设备feature 特性field 栏位,资料栏(Java)字段, 值域(Java)file 档案文件firmware 韧体固件flag 旗标标记flash memory 快闪记忆体闪存flexibility 弹性灵活性flush 清理、扫清刷新font 字型字体form 表单(programming 用语)窗体formal parameter 形式叁数形式叁数forward declaration 前置宣告前置声明forwarding 转呼叫,转发转发forwarding function 转呼叫函式,转发函式转发函数fractal 碎形分形framework 框架框架full specialization 全特化(ref. partial specialization)function 函式、函数函数function call operator 同 call operatorfunction object 函式物件(ref. C++ Primer 3/e, 12.3)函数对象function overloaded resolution函式多载决议程序函数重载解决(方案)functionality 功能、机能功能function template 函式模板、函式范本函数模板functor 仿函式仿函式、函子game 游戏游戏generate 生成generic 泛型、一般化的一般化的、通用的、泛化generic algorithm 泛型演算法通用算法getter (相对於 setter) 取值函式global 全域的(对应於 local)全局的global object 全域物件全局对象global scope resolution operator全域生存空间(范围决议)运算子 :: 全局范围解析操作符group 群组group box 群组方块分组框guard clause 卫述句 (Refactoring, p250) 卫语句GUI 图形介面图形界面hand shaking 握手协商handle 识别码、识别号、号码牌、权柄句柄handler 处理常式处理函数hard-coded 编死的硬编码的hard-copy 硬拷图屏幕截图hard disk 硬碟硬盘hardware 硬体硬件hash table 杂凑表哈希表、散列表header file 表头档、标头档头文件heap 堆积堆hierarchy 阶层体系层次结构(体系)hook 挂钩钩子hyperlink 超链结超链接icon 图示、图标图标IDE 整合开发环境集成开发环境identifier 识别字、识别符号标识符if and only if 若且唯若当且仅当Illinois 伊利诺伊利诺斯image 影像图象immediate base 直接的(紧临的)上层 base class。
Java编程语言基础(外文文献翻译)(可编辑)
JavaTM Programming Language BasicsLike applications, applets are created from classes. However, applets do not have a main method as an entry point, but instead, have several methods to control specific aspects of applet execution.This lesson converts an application from Lesson 2 to an applet and describes the structure and elements of an applet.1、Application to Applet2、Run the Applet3、Applet Structure and Elements4、Packages5、More Information1、Application to AppletThe following code is the applet equivalent to the LessonTwoB application from Lesson 2. The figure below shows how the running applet looks. The structure and elements of the applet code are discussed after the section on how to run the applet just below.import et;import hics;import r;public class SimpleApplet extends AppletString text "I'm a simple applet";public void inittext "I'm a simple applet";setBackground Color.cyan ;public void startSytln "starting..." ;public void stopSytln "stopping..." ;public void destroySytln "preparing to unload..." ;public void paint Graphics gSytln "Paint" ;g.setColor Color.blue ;g.drawRect 0, 0,getSize .width -1,getSize .height -1 ;g.setColor Color.red ;g.drawString text, 15, 25 ;The SimpleApplet class is declared public so the program that runs the applet a browser or appletviewer , which is not local to the program can access it.2、Run the AppletTo see the applet in action, you need an 6>HTML file with the Applet tag as follows:APPLET CODE SimpleApplet.class WIDTH 200 HEIGHT 100The easiest way to run the applet is with appletviewer shown below where simpleApplet.html is a file that contains the above HTML code:appletviewer simpleApplet.htmlNote: To run an applet written with JavaTM 2 APIs in a browser, the browser must be enabled for the Java 2 Platform. If your browser is not enabled for the Java 2 Platform, you have to use appletviewer to run the applet or install Java Plug-in. Java Plug-in lets you run applets on web pages under the 1.2 version of the Java VM instead of the web browser's default Java VM.3、Applet Structure and ElementsThe Java API Applet class provides what you need to design the appearance and manage the behavior of an applet. This class provides a graphical user interface GUI component called a Panel and a number of methods. To create an applet, you extend or subclass the Applet class and implement the appearance and behavior you want.The applet's appearance is created by drawing onto the Panel or by attaching other GUI components such as push buttons, scrollbars, or text areas to the Panel. The applet's behavior is defined by implementing the methods.3.1 Extending a ClassMost classes of any complexity extend other classes. To extend another class means to write a new class that can use the fields and methods defined in the class being extended. The class being extended is the parent class, and the class doing the extending is the child class. Another way to say this is the child class inherits the fields and methods of its parent or chain of parents. Child classes either call or override inherited methods. This is called single inheritance.The SimpleApplet class extends Applet class, which extends the Panel class, which extends the Container class. The Container class extends Object, which is the parent of all Java API classes. The Applet class provides the init, start, stop, destroy, and paint methods you saw in the example applet. The SimpleApplet class overrides these methods to do what the SimpleApplet class needs them to do. The Applet class provides no functionality for these methods.However, the Applet class does provide functionality for the setBackground method,which is called in the init method. The call to setBackground is an example of calling a method inherited from a parent class in contrast to overriding a method inherited from a parent class.You might wonder why the Java language provides methods without implementations. It is to provide conventions for everyone to use for consistency across Java APIs. If everyone wrote their own method to start an applet, for example, but gave it a different name such as begin or go, the applet code would not be interoperable with other programs and browsers, or portable acrossmultiple platforms. For example, Netscape and Internet Explorer know how to look for the init and start methods.3.2 BehaviorAn applet is controlled by the software that runs it. Usually, the underlying software is a browser, but it can also be appletviewer as you saw in the example. The underlying software controls the applet by calling the methods the applet inherits from the Applet class.The init Method: The init method is called when the applet is first created and loaded by the underlying software. This method performs one-time operations the applet needs for its operation such as creating the user interface or setting the font. In the example, the init method initializes the text string and sets the background color.The start Method: The start method is called when the applet is visited such as when the end user goes to a web page with an applet on it. The example prints a string to the console to tell you the applet is starting. In a more complex applet, the start method would do things required at the start of the applet such as begin animation or play sounds.After the start method executes, the event thread calls the paint method to draw to the applet's Panel. A thread is a single sequential flow of control within the applet, and every applet can run in multiple threads. Applet drawing methods are always called from a dedicated drawing and event-handling thread.The stop and destroy Methods: The stop method stops the applet when the applet is no longer on the screen such as when the end user goes to another web page. The example prints a string to the console to tell you the applet is stopping. In a more complex applet, this method should do things like stop animation or sounds.The destroy method is called when the browser exits. Your applet should implement this method to do final cleanup such as stop live threads.3.3 AppearanceThe Panel provided in the Applet class inherits a paint method from its parent Container class. To draw something onto the Applet's Panel, you implement the paint method to do the drawing. The Graphics object passed to the paint method defines a graphics context for drawing on the Panel. The Graphics object has methods for graphical operations such as setting drawing colors, and drawing graphics, images, and text.The paint method for the SimpleApplet draws the I'm a simple applet string in red inside a blue rectangle.public void paint Graphics gSytln "Paint" ;//Set drawing color to blueg.setColor Color.blue ;//Specify the x, y, width and height for a rectangleg.drawRect 0, 0,getSize .width -1,getSize .height -1 ;//Set drawing color to redg.setColor Color.red ;//Draw the text string at the 15, 25 x-y locationg.drawString text, 15, 25 ;4、PackagesThe applet code also has three import statements at the top. Applications of any size and all applets use import statements to access ready-made Java API classes in packages. This is true whether the Java API classes come in the Java platform download, from a third-party, or are classes you write yourself and store in a directory separate from the program. At compile time, a program uses import statements to locate and reference compiled Java API classes stored in packages elsewhere on the local or networked system. A compiled class in one package can have the same name as a compiled class in another package. The package name differentiates the two classes.The examples in Lessons 1 and 2 did not need a package declaration to call the Sytln Java API class because the System class is in the ng package that is included by default. You never need an import ng.* statement to use the compiled classes in that package.5、More InformationYou can find more information on applets in the Writing Applets trail in The Java Tutorial.文献译文Java 编程语言基础像Java Application小应用程序一样,Java Applet小程序也是从类中创建来的。
java中英文对照
1 . Introduction To Objects1.1The progress of abstractionAll programming languages provide abstractions. It can be argued that the complexity of the problems you’re able to solve is directly related to the kind and quality of abstraction. By “kind” I mean, “What is it that you are abstracting?” Assembly language is a small abstraction of the underlying machine. Many so-called “imperative” languages that followed (such as FORTRAN, BASIC, and C) were abstractions of assembly language. These languages are big improvements over assembly language, but their primary abstraction still requires you to think in terms of the structure of the computer rather than the structure of the problem you are trying to solve. The programmer must establish the association between the machine model (in the “solution space,” which is the place where you’re modeling that problem, such as a computer) and the model of the problem that is actually being solved (in the “problem space,” which is the place where the problem exists). The effort required to perform this mapping, and the fact that it is extrinsic to the programming language, produces programs that are difficult to write and expensive to maintain, and as a side effect created the entire “programming methods” industry.The alter native to modeling the machine is to model the problem you’re trying to solve. Early languages such as LISP and APL chose particular views of the world (“All problems are ultimately lists” or “All problems are algorithmic,” respectively). PROLOG casts all problems into chains of decisions. Languages have been created for constraint-based programming and for programming exclusively by manipulating graphical symbols. (The latter proved to be too restrictive.) Each of these approaches is a good solution to the particular class of problem they’re designed to solve, but when you step outside of that domain they become awkward.The object-oriented approach goes a step further by providing tools for the programmer to represent elements in the problem space. This representation is general enough that the programmer is not constrained to any particular type of problem. We refer to the elements in the problem space and their representations in the solution space as “objects.” (You will also need other objects that don’t have problem-space analogs.) The idea is that the program is allowed to adapt itself to the lingo of the problem by adding new types of objects, sowhen you read the code describing the solution, you’re reading words that also express the problem. This is a more flexible and powerful language abstraction than what we’ve had before. Thus, OOP allows you to describe the problem in terms of the problem, rather than in terms of the computer where the solution will run. There’s still a connection back to the computer: each object looks quite a bit like a little computer—it has a state, and it has operations that you can ask it to perform. However, this doesn’t seem like such a bad analogy to objects in the real world—they all have characteristics and behaviors.Alan Kay summarized five basic characteristics of Smalltalk, the first successful object-oriented language and one of the languages upon which Java is based. These characteristics represent a pure approach to object-oriented programming:1.Everything is an object.Think of an object as a fancy variable; it stores data, but you can “makerequests” to that object, asking it to perform operations on itself. In theory, you can take any conceptual component in the problem you’re trying to solve (dogs, building s, services, etc.) and represent it as an object in your program.2. A program is a bunch of objects telling each other what to do by sending messages. To make arequest of an object, you “send a message” to that object. More concretely, you can think of a m essage as a request to call a method that belongs to a particular object.3.Each object has its own memory made up of other objects. Put another way, you create a new kindof object by making a package containing existing objects. Thus, you can build complexity into a program while hiding it behind the simplicity of objects.4.Every object has a type. Using the parlance, each object is an instance of a class, in which “class” issynonymous with “type.” The most important distinguishing characteristic of a class is “What messages can you send to it?”5.All objects of a particular type can receive the same messages. This is actually a loaded statement,as you will see later. Because an object of type “circle” is also an object of type “shape,” a circle is guaranteed to accept shape messages. This means you can write code that talks to shapes and automatically handle anything that fits the description of a shape. This substitutability is one of the powerful concepts in OOP.Booch offers an even more succinct description of an object:An object has state, behavior and identity.This means that an object can have internal data (which gives it state), methods (to produce behavior), and each object can be uniquely distinguished from every other object—to put this in a concrete sense, each object has a unique address in memory.1.2 An object has an interfaceAristotle was probably the first to begin a careful study of the concept of type;he spoke of “the class of fishes and the class of birds.” The idea that all objects, while being unique, are also part of a class of objects that have characteristics and behaviors in common was used directly in the first object-oriented language, Simula-67, with its fundamental keyword class that introduces a new type into a program.S imula, as its name implies, was created for developing simulations such as the classic “bank teller problem.” In this, you have a bunch of tellers, customers, accounts, transactions, and units of money—a lot of “objects.” Objects that are identical except for their state during a program’s execution are grouped together into “classes of objects” and that’s where the keyword class came from. Creating abstract data types (classes) is a fundamental concept in object-oriented programming. Abstract data types work almost exactly like built-in types: You can create variables of a type (called objects or instances in object-oriented parlance) and manipulate those variables (called sending messages or requests; you send a message and the object figures out what to do with it). The members (elements) of each class share some commonality: every account has a balance, every teller can accept a deposit, etc. At the same time, each member has its own state: each account has a different balance, each teller has a name. Thus, the tellers, customers, accounts, transactions, etc., can each be represented with a unique entity in the computer program. This entity is the object, and each object belongs to a particular class that defines its characteristics and behaviors.So, although what we really do in object-oriented programming is create new data types, virtually all object-oriented programming languages use the “class” keyword. When you see the word “type” think “class” and vice versa.Since a class describes a set of objects that have identical characteristics (data elements) and behaviors (functionality), a class is really a data type because a floating point number, for example, also has a set ofcharacteristics and behaviors. The difference is that a programmer defines a class to fit a problem rather than being forced to use an existing data type that was designed to represent a unit of storage in a machine. You extend the programming language by adding new data types specific to your needs. The programming system welcomes the new classes and gives them all the care and type-checking that it gives to built-in types.The object-oriented approach is not limited to building simulations. Whether or not you agree that any program is a simulation of the system you’re designing, the use of OOP techniques can easily reduce a large set of problems to a simple solution.Once a class is established, you can make as many objects of that class as you like, and then manipulate those objects as if they are the elements that exist in the problem you are trying to solve. Indeed, one of the challenges of object-oriented programming is to create a one-to-one mapping between the elements in the problem space and objects in the solution space.But how do you get an object to do useful work for you? There must be a way to make a request of the object so that it will do something, such as complete a transaction, draw something on the screen, or turn on a switch. And each object can satisfy only certain requests. The requests you can make of an object are defined by its interface, and the type is what determines the interface. A simple example might be a representation of a light bulb:Light lt = new Light();lt.on();The interface establishes what requests you can make for a particular object. However, there must be code somewhere to satisfy that request. This, along with the hidden data, comprises the implementation. From a procedural programming standpoint, it’s not that complicated. A type has a method associated with each possible request, and when you make a particular request to an object, that method is called. This process isusually summarized by saying that you “send a message” (make a request) to an object, and the object figures out what to do with that message (it executes code).Here, the name of the type/class is Light, the name of this particular Light object is lt,and the requests that you can make of a Light object are to turn it on, turn it off, make it brighter, or make it dimmer. You create a Light object by defining a “reference” (lt) for that object and calling new to request a new object of that type. To send a message to the object, you state the name of the object and connect it to the message request with a period (dot). From the standpoint of the user of a predefined class, that’s pretty much all there is to programming with objects.The preceding diagram follows the format of the Unified Modeling Language(UML). Each class is represented by a box, with the type name in the top portion of the box, any data members that you care to describe in the middle portion of the box, and the methods(the functions that belong to this object, which receive any messages you send to that object) in the bottom portion of the box. Often, only the name of the class and the public methods are shown in UML design diagrams, so the middle portion is not shown. If you’re interested only in the class name, then the bottom portion doesn’t need to be shown, either1.3 An object provides services.While you’re trying to develop or understand a program design, one of the best ways to think about objects is as “service providers.” Your program itself will provide services to the user, and it will accomplish this by using the services offered by other objects. Your goal is to produce (or even better, locate in existing code libraries) a set of objects that provide the ideal services to solve your problem.A way to start doing this is to ask “if I could magically pull them out of a hat, what objects would solve my problem right away?” For example, suppose you are creating a bookkeeping program. You might imagine some objects that contain pre-defined bookkeeping input screens, another set of objects that perform bookkeeping calculations, and an object that handles printing of checks and invoices on all different kinds of printers. Maybe some of these objects alread y exist, and for the ones that don’t, what would they look like? What services would those objects provide, and what objects would they need to fulfill their obligations? If you keep doing this, you will eventually reach a point where you can say either “t hat object seems simpleenough to sit down and write” or “I’m sure that object must exist already.” This is a reasonable way to decompose a problem into a set of objects.Thinking of an object as a service provider has an additional benefit: it helps to improve the cohesiveness of the object. High cohesion is a fundamental quality of software design: It means that the various aspects of a software component (such as an object, although this could also apply to a method or a library of objects) “fit togethe r” well. One problem people have when designing objects is cramming too much functionality into one object. For example, in your check printing module, you may decide you need an object that knows all about formatting and printing. You’ll probably discover that this is too much for one object, and that what you need is three or more objects. One object might be a catalog of all the possible check layouts, which can be queried for information about how to print a check. One object or set of objects could be a generic printing interface that knows all about different kinds of printers (but nothing about bookkeeping—this one is a candidate for buying rather than writing yourself). And a third object could use the services of the other two to accomplish the task. Thus, each object has a cohesive set of services it offers. In a good object-oriented design, each object does one thing well, but doesn’t try to do too much. As seen here, this not only allows the discovery of objects that might be purchased (the printer interface object), but it also produces the possibility of an object that might be reused somewhere else (the catalog of check layouts).Treating objects as service providers is a great simplifying tool, and it’s very useful not only during the design process, but also when someone else is trying to understand your code or reuse an object—if they can see the value of the object based on what service it provides, it makes it much easier to fit it into the design.1. 对象入门1.1 抽象的进步所有编程语言的最终目的都是提供一种“抽象”方法。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Java语言与面向对象思想翻译(中英文)Java语言与面向对象思想Java,是由Sun Microsystems公司于1995年5月推出的Java程序设计语言和Java的总称。
用Java实现的Hot Java 浏览器(支持Java applet)显示了Java的魅力:跨平台、动态的Web、Internet计算。
从此,Java被广泛接受并推动了Web的迅速发展,常用的浏览器现在均支持Java applet。
1 Java语言的特点Java语言适用于Internet环境,是一种被广泛使用的网络编程语言,它具有如下的一些特点: 简单Java语言的语法规则和C++类似,但Java语言取消了指针和多重继承,统一使用引用来指示对象(C++中有两种形式,实际上是两种产生对象的途径,而Java 中只有一种),通过自动垃圾收集免去了程序设计人员对于内存块的释放工作。
面向对象(近于完全)Java语言为了提高效率,定义了几个基本的数据类型以非类的方式实现,余下的所有数据类型都以类的形式进行封装,程序系统的构成单位也是类。
因而几乎可以认为是完全面向对象。
平台无关性(可移植、跨平台)Java虚拟机(JVM)是在各种体系结构真实机器中用软件模拟实现的一种想象机器,必要时候可以用硬件实现。
当然,这些虚拟机内部实现各异,但其功能是一致的——执行统一的Java虚拟机指令。
Java编译器将Java 应用程序的源代码文件(.java)翻译成Java字节码文件(.class),它是由Java虚拟机指令构成的。
由于是虚拟机器,因而Java虚拟机执行Java程序的过程一般称为解释。
依赖于虚拟机技术,Java语言具有与机器体系结构无关的特性,即Java程序一旦编写好之后,不需进行修改就可以移植到任何一台体系结构不同的机器上。
从操作系统的角度看,执行一次Java程序的过程就是执行一次Java 虚拟机进程的过程。
面向网络编程Java语言产生之初就面向网络,在JDK中包括了支持TCP/IP、HTTP和FTP等协议的类库。
多线程支持多线程是程序同时执行多个任务的一种功能。
多线程机制能够使应用程序并行执行多项任务,其同步机制保证了各线程对共享数据的正确操作。
良好的代码安全性运行时(Runtime)一词强调以动态的角度看程序,研究程序运行时候的动态变化,也用运行时环境一词表达类似的含义。
Java技术的很多工作是在运行时完成的,如加强代码安全性的校验操作。
一般地,Java技术的运行环境执行如下三大任务:加载代码——由类加载器执行类加载器为程序的执行加载所需要的全部类(尽可能而未必同时)。
校验代码——由字节码校验器执行Java代码在实际运行之前要经过几次测试。
字节码校验器对程序代码进行四遍校验,这可以保证代码符合JVM规范并且不破坏系统的完整性。
如,,检查伪造指针、违反对象访问权限或试图改变对象类型的非法代码。
执行代码——由运行时的解释器执行自动垃圾收集许多编程语言都允许在程序运行时动态分配内存块,分配内存块的过程由于语言句法不同而有所变化,但总是要返回指向存储区起始位置的指针。
在C,C++ 及其它一些语言中,程序员负责取消分配内存块。
有时这是一件很困难的事情。
因为程序员并不总是事先知道内存块应在何时被释放。
当在系统中没有能够被分配的内存块时,可导致程序瘫痪,这种程序被称作具有内存漏洞。
当分配内存块不再需要时,程序或运行环境应取消分配内存块。
垃圾收集就是将不再需要的已分配内存块回收。
在其它一般的语言中,取消分配是程序员的责任。
Java编程语言提供了一种系统级线程以跟踪存储区分配,来完成垃圾收集:可检查和释放不再需要的存储块可自动完成上述工作可在JVM实现周期中,产生意想不到的变化良好的代码健壮性Java能够检查程序在编译和运行时的错误。
类型检查能帮助用户检查出许多在开发早期出现的错误。
同时很多集成开发工具(IDE)的出现使编译和运行Java程序更加容易,并且很多集成开发工具(如Eclipse)都是免费的。
2 面向对象与面向过程的差异一种程序设计语言的产生,不仅是程序设计技术的改进,也包含了表达和认知思想的进步。
以C语言为代表的部分早期语言,被称为面向过程的语言,不仅因为其程序设计的表达形式是以过程为基本元素,本质上更在于此时对计算机化的系统的理解的主导思想还是控制流或者数据流的,构成系统的要素是模块——处理逻辑。
面向对象语言的产生,是因为对于系统的理解或抽象到了更为高级的层次。
此时的认知思想不仅更接近于现实世界,其抽象程度也很高。
因而,既有易懂的一方面,也有难懂的另一方面,就看理解的境界了。
2.1 面向过程思想回顾面向过程思想和程序设计语言的体现,可以简单总结为以下几条:对系统的认识采用结构化分析的过程——自顶向下,逐步求精地进行功能分解; 每个功能就是处理数据的一个模块,因而IPO描述充分刻画了模块的内外特征; 每个模块都是控制流的,因而有典型的三种程序结构——顺序、分支、循环; 模块间的关系通过调用维系,因而模块成为了函数,这也是面向过程方式下最主要的代码重用方式;尽管函数调用有参数和返回值,但数据总是和函数分开的,不仅有了著名的断言——程序=算法+数据,也使得绝对平等产生了无序的麻烦——所有的函数和数据的关联关系没有限制;如果要使用数据流,那么只能是在数据产生之后的适当时机调用函数。
这一时期的主要缺点是:对系统的理解比较难,系统地开发效率低,代码的可重用性差。
2.2 面向对象思想介绍面向对象思想,对现实世界采用直观的理解,计算机化时候采用深度的抽象,简单地可以总结如下:系统是由事物构成的,事物之间是有联系的,复杂的事物也是系统;系统与系统、系统与事物、事物与事物之间是有明确界限(边界)的;系统或事物的状态刻画可以用属性表示,属性一般是些简单的数据,如果复杂那就是事物了;系统或事物的状态会发生变化,称为行为,产生变化是有原因的(内部的或外部的),变化的过程可能是复杂的;不同的事物之间会具有共同的属性和行为,共同的极端情形就是完全包含。
基于以上的认识,一个运行时(动态)的具体系统或事物,是由几个更小的具体事物构成(极端的事物就是一个简单的属性数据),它们是不断发生变化的。
如果对事物这一概念进行了有效的抽象,那么问题就迎刃而解。
首先,将任何一个具体的事物称为对象(Object),它的极端情形就是过去的变量;事物是分类的,每一类事物都具有统一的属性和行为,即类型——抽象数据类型,简称为类(Class);行为既然是过程,那么就抽象成函数,命名为方法,以示区别。
例如:描述身高或姓名,各自只是一个简单的数据变量;描述一个学生,可以使用学号、姓名、宿舍、班级等;那更换宿舍算什么呢~那描述宿舍、班级,又要有许多个项目。
3面向对象程序设计中的主要概念和特征面向对象程序设计(Object Oriented Programming,OOP)语言中,为了进行更为高度的抽象,会引入一些现实世界中难于找到的概念,但对于一个程序语言来说确实很有价值的。
以下暂时介绍的概念基本上都来源于对现实世界的抽象,要从程序设计的角色中去理解它们。
面向对象程序设计使系统更易于理解,也使代码具有更好的重用性、可扩展性、易于管理和维护。
3.1 主要概念(1)、类类是对一类事物的抽象表示,其角色就相当于数据类型,当然可以算作复杂的数据类型。
如学生、宿舍、班级。
(2)、对象对象表示一个具体的事物,其角色就是变量,即一个复杂数据类型——xx类的变量。
如周瑜、张飞、瑜飞居,飞虎班。
(3)、成员一个事物的构成元素,讨论类的时候就是虚拟的,讨论对象的时候就是具体的。
如在类中,一个变量属于成员——成员变量,一个对象也属于成员——成员对象,一个函数也属于成员——成员方法。
3.2 主要特征OOP语言有三个特征:封装、继承及多态性。
(1)、封装类的构成包括成员变量/对象与成员方法,这样将相关的数据与函数包装在一起,同其他的类相区分,就是封装。
显然,避免了面向过程语言的平行缺陷,说明了类和成员之间的所属关系。
进一步地,可以限制类的成员在外部的可见性,那么就将封装体现得更完美。
(2)、继承当一种事物甲完全是另一种事物乙的特例,那么,一般地,类甲只是比类乙多出一些成员变量/对象与成员方法,称为类甲继承类乙,类甲称为(类乙的)子类,类乙称为(类甲的)父类。
父类也称为基类、超类,子类也称为导出类、派生类。
显然编写子类就没有必要重复书写父类中乙有的代码部分,这是OOP中最典型的代码重用。
(3)、多态多态表示一个类的某种行为存在多种实现版本。
简单的情况是在一个类中,给出多种不同的实现,复杂的情况是在多个子类中各自给出不同的实现。
Overview of Java languageJava, from Sun Microsystems, launched in May 1995 of the Java programming language and Java in general. Hot Java implementation with Java browser (supporting Java applet) shows the charm of Java: cross-platform, dynamic Web, Internet computing. Since then, Java is widely accepted and promoted the rapid development of Web, popular browsers now support Java applet1 Java Language FeaturesJava language for Internet environment, is a widely used web programming language, it has the following features:SimpleJava language and C + + syntax rules are similar, but canceled the Java language and multiple inheritance pointer, unified by reference to indicate the object (C + + in two forms, is actually two ways to generate objects, and Java, there is only one) by automatic garbagecollection eliminates the need for programmers working for the release of the memory block.object-oriented (nearly complete)Java language in order to improve efficiency, defined a few basic data types to achieve a non-class manner, and the remaining class of all data types in the form of packaging, the program structure of the system unit is also a class. Therefore considered to be almost completely object-oriented.platform independent (portable, cross-platform)Java Virtual Machine (JVM) is true in a variety of machine architectures implemented using software to simulate an imaginary machine, when necessary, can be implemented by hardware.Of course, the internal implementation of these virtual machines vary, but its function is the same - the implementation of a unified Java virtual machine instructions.Java compiler Java application's source code files (. Java) translated into Java byte code file (. Class), which is composed of Java virtual machine instructions. Because it is a virtual machine, and thus the implementation of Java Virtual Machine Java programs commonly referred to as the process of interpretation.Relies on virtual machine technology, Java language has nothing todo with the characteristics of the machine architecture, that Java programs, once after being written, can be transplanted without modification to any one on a different machine architecture. From theoperating system point of view, the process of implementation of a Java program is the process of implementation of a Java virtual machine process.oriented network programmingJava language for generating the beginning of the network of supportin the JDK includes TCP / IP, HTTP and FTP protocols such as class libraries.Multi-threading supportMultithreading is to simultaneously perform multiple tasks of a function. Multi-threading mechanism that enables applications to perform multiple tasks in parallel, the various thread synchronization mechanisms to ensure proper operation of the shared data.Good security codeRuntime (Runtime) term perspective emphasizes the dynamic process of the dynamic changes when the program is running, but also with the expression of the runtime environment similar to the meaning of the word.Java technology is a lot of work done at run time, such as strengthening security code verification operations.In general, Java technology runtime environment performs thefollowing three major tasks:loading code - the implementation by the class loaderClass loader for the implementation of the procedures required toload all classes (as far as possible and not necessarily the same).validation code - the implementation of the byte code verifierJava code before the actual operation after several tests. Byte code verifier for four times on the validation code, which can ensure code compliance and does not destroy the JVM specification system integrity.If - Check forged pointers, object access rights violation or attempt to change the object type of illegal code.code execution - from the implementation of the runtime interpreterAutomatic garbage collectionMany programming languages allow programs running in the memoryblock dynamically allocated, the process of allocating memory blocks because of the language syntax varies, but always point to the store to return to the starting position of the pointer. In C, C + + and other languages, the programmer is responsible for deallocation of memory blocks. Sometimes this is a very difficult task. Because programmers do not always know in advance when a block of memory should be released. When not in the system can be allocated memory block, it can cause the program to a standstill, this procedure is called a memory leak.When the allocated memory block is no longer needed, the programshould be canceled or the operating environment to allocate memory block.garbage collection is no longer needed recovery of allocated memory block. In other languages in general, is the programmer's responsibility to cancel the allocation.Java programming language provides a system-level threads to keep track of memory allocation, to complete the garbage collection:No longer need to check and release the memory block,The above work can be completed automatically,In the JVM implementation cycle, resulting in unexpected changes,Good robustness of the code.Java program to check at compile and run-time errors. Type of examination can help detect many errors early in development. Meanwhile, many integrated development tools (IDE) to compile and run the emergence of Java programs easier and a lot of integrated development tools (eg Eclipse) are free.2 Object-oriented and process-oriented differencesThe production of a programming language, programming is not only a technical improvement, but also includes the expression of ideas andcognitive progress. The C language as the representative of the early part of the language, known asprocess-oriented language, not only because of their expression of program design is based on the basic elements of the process, in essence, is now more understanding of the computerized system the dominant ideology or control flow or data flow, constitute elements of the system is the module - processing logic.The generation of object-oriented languages, because the understanding of the system or the abstract to a more advanced level. Cognitive thinking at this time not only closer to the real world, andits high degree of abstraction. Thus, both easy to understand on the one hand, there are also difficult to understand the other hand, to see the realm of understanding.2.1 Review process-oriented thinkingProcess-oriented programming language, thought and expression, canbe simply summarized as the following few:Understanding of the system structure analysis of the process - top-down, stepwise refinement to the functional decomposition;Each function is a data processing module, which fully describe the IPO described the internal and external features of the module;Each module is control flow, and therefore have a typical structureof the three procedures - sequence, branch, loop;The relationship between the module by calling the preserve, which has become a function module, which is the most important process-oriented way of code reuse under way;Although the function call parameters and return values, but thedata and functions are always separate, not only with the famous assertion - program = algorithm + data, but also makes the absolute equality of the disorder have trouble - all the functions and data relationship is no limit;If you want to use the data flow, then the data can only be produced in an appropriate time after the call function.The main drawback of this period are: understanding the system more difficult, the systematic development of low efficiency, codereusability is poor.2.2 OOPObject-oriented thinking on the use of an intuitive understanding of the real world, when the use of computerized depth of abstraction can be summarized briefly as follows: System is composed of things, there is a connection between things, the complexity is system;System and the system, and things, things and things is a clear boundary between the (boundary) of;System or the state of things can describe the property, said property is usually some simple data, if that is something the complex;System or the state of things will change, called the behavior of a difference there is a reason (internal or external), changes in the process may be complex;Will have different things in common between the properties and behavior, a common extreme case is completely contained.Based on the above understanding, a runtime (dynamic) to thespecific system or something, by several smaller things that constitute a specific (extreme things is a simpleattribute data), which is constantly changing. If this concept of things an effective abstract, then the problem is solved.First of all, any one specific thing called the object (Object), it is the extreme case of previous variables; things are classified, each class of things have the properties and behavior of uniform, that type - abstract data types, referred to as for the class (Class); behavior since it is the process, then a function of the abstract, named for the method to show the difference.For example:Describe the height or name, each just a simple data variable;Describe a student, you can use the student number, name, dorm, class, etc.; What kind of accommodation that replaced it!It describes the dorm, class, and also has many projects.3 Object-oriented programming concepts and features of the mainObject-oriented programming (Object Oriented Programming, OOP) language, in order to be more highly abstract, will introduce some ofthe real world, the concept is difficult to find, but for a programming language is indeed valuable. The following describes the concept ofbeing basically derived from the abstract to the real world, from therole of program design to understand them.Object-oriented programming to make the system easier to understand, but also make the code better reusability, scalability, easy management and maintenance.3.1 Main Concepts(1) classClass is the abstract of a class of things that the data type is equivalent to its role, of course, can be regarded as complex data types. Such as students, dormitories, class. (2) the objectObject represents a specific thing, its role is variable, that is, a complex data type - xx class variables. Such as Zhou Yu, Zhang Fei, Yufly home, Tiger classes. (3) membersThe elements of a thing to discuss when the class is virtual, it is the discussion of specific objects. As in class, a variable belonging to members - member variable, an object also belong to members - members of the object, a function also belong to the members - members of the method.3.2 Main FeaturesThere are three features of OOP languages: encapsulation,inheritance and polymorphism.(1) packageThe composition includes members of the class variables / objects and members of the method, so the relevant data and functions will be packaged together with other distinguished class is package. Obviously, avoiding the process-oriented parallel language defects, indicating the class and members of their respective relationships. Further, members of the class can limit the visibility of the external, then the packagewill reflect the more perfect.(2) inheritanceWhen a thing is another thing entirely a special case of B, then, in general, the class Aclass B is more than the number of member variables / objects and members of the method, called class A inherits class B and class A is called ( Class B's) sub-class, class B is called (Class A) for the parent class.Parent, also known as the base class, superclass, subclass, also known as derived class, derived class.Obviously there is no need to write duplicate subclass the parent class to write some code in Part B, which is the most typical OOP code reuse.(3) multi-statePolymorphism that an act of a class there are several implementation version. The simplest case is in a class, given a variety of different implementations, the complex is in many different sub-classes are given in their implementation.。