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实现的英汉词典import java.io.*;import java.util.*;public class MyDictionary {static private Map<String, String > dict= new HashMap();static private int size;public static int getSize(){return size;}public static void insertPare(String EN, String CN){dict.put(EN, CN);size ++;}public static void flushToFile() throws IOException{File file = new File("dict.dat");FileOutputStream fop = new FileOutputStream(file);ObjectOutputStream oos = new ObjectOutputStream(fop);oos.writeObject(dict);oos.flush();oos.close();fop.close();}public static Map<String, String> getFromFile(String fileName)throws IOException, ClassNotFoundException{FileInputStream fis = new FileInputStream(fileName);ObjectInputStream ois = new ObjectInputStream(fis);Map<String, String> dict = (Map<String, String>) ois.readObject();fis.close();ois.close();return dict;}public static String query(String EN)throws IOException, ClassNotFoundException{Map<String, String> map = getFromFile("dict.dat");return map.get(EN);}public static void main(String[] args){insertPare("amnesty", "赦免");insertPare("torture","虐待");insertPare("scandal","丑闻");try {flushToFile();System.out.print("your query: ");Scanner scan = new Scanner(System.in);String read = scan.nextLine();System.out.println(query(read));}catch (Exception e){}}}真可谓是⼈⽣不易,⼩学期过得艰难。
java课程设计——英汉电子词典编程

Java课程设计——英汉电子词典一、需求分析二十世纪后半叶,以电子计算机为代表的现代科学获得了突飞猛进的发展并迅速和人们的日常生活结合在一起。
计算机技术的发展和进步也使电子语言词典的诞生成为可能。
我们日常的学习生活中,常会遇到这样的问题:在工作时或在网上冲浪,或者电子邮箱中收到一封外国朋友发的英文E-mail,遇到某些陌生的单词,可又疲于去翻查厚重的英文字典时,电脑中所安装的英汉电子词典便成为了最为方便、快捷的选择。
电子词典是一种多功能的词典类工具软件,它可以即时翻译,快速、准确、详细地查阅英文单词,或将中文单词进行英文翻译,使自己的知识面拓展得更宽、更广。
尽管电子词典只有十来年的历史,但它却已经发展壮大,成为词典家族中具有旺盛生命力的一员。
虽然目前它尚不足以取代传统词典,但在英语学习和教学中,由于它实用、快捷、准确、经济等特点,已经成为传统英汉词典的有力竞争者,并对传统的词典提出了挑战。
本系统是一个采用Microsoft Access作为数据库,用JAVA作为开发工具的英汉电子词典,内有英汉词典、汉英词典和备份词库。
它不仅可实现英译汉、汉译英的基本翻译功能,还可以让用户根据自己的需要添加、修改、删除词库,形成自己的词库。
其功能结构图如图1.1所示:英语小词典文件编辑英汉词典汉英词典备份词库退出添加词汇修改词汇删除词汇图1.1功能结构图功能模块说明:1、英译汉功能模块说明:可以实现对英文单词对中文单词的查询功能。
用户文本框中输入要查询的英语单词。
若该单词存在于词库中,则会在文件对话框中显示其词性及中文翻译;若该单词没有存在于词库中,则会弹出“警告”,说明“查无此词”;若没有输入直接点击“查询”,则会弹出“警告”,说明“查询对象不能为空”。
2、汉译英功能模块说明:可以实现对中文单词对英文单词的查询功能。
用户可在文本框中输入要查询的中文单词。
若该单词存在于词库中,则会在文件对话框中显示一个或多个对应的英文;若该单词没有存在于词库中,则会弹出“警告”,说明“查无此词”;若没有输入直接点击“查询”,则会弹出“警告”说明“查询对象不能为空”。
JAVA编程常用英文单词汇总

JAVA编程常用英文单词汇总Java Basic Common English Vocabulary (70 in total)OO: object-oriented。
oriented towards objectsOOP: object-oriented programming。
oriented towards object programmingJDK: Java development kit。
Java development toolkitJVM: Java virtual machine。
Java virtual machine___: ___Run: runClass: classObject: objectSystem: systemout: outputprint: printline: linevariable: variabletype: typen: n。
narray: array parameter: parameter method: methodn: n___-variable: ___ variable n: ___get: getset: setpublic: publicprivate: private protected: protected default: default access: access package: package import: importstatic: staticvoid: void (return type) extends: extendsparent class: parent class base class: base classsuper class: super classchild class: child classderived class: derived classoverride: override。
overwriteoverload: overloadfinal: final。
JAVA与“英汉小词典”的实现

JA V A与“英汉小词典”的实现叙又2OO8.O4(下删)圆JV与"英汉小词典"的实现口许媛(陕西安康职业技术学院陕西?安康725000)摘要本文叙述了Java的出现背景,主要特点以及用Java语言制作的英汉小词典,指出Java是当今1T产业和人类文明的创新和希望.关键词程序设计JA V AJDBC英汉小词典中图分类号:G434文献标识码:A文章编号:1672—7894(2008}04—059—01——,JavaJava是1995年6月由Sun公司的JamesGosling开发的革命性编程语言.它以c++为基础,但是却是一个全新的软件开发语言.Java能使所有东西从桌面计算平稳的转变为基于网络的计算,它是专门为此而建立的,并显然是为了完成这个任务而来的.使用Java,我们可以相对轻松的一天编写一个有条理的网络程序.今天,Java的网络功能正在飞跃发展,不断有新的特性增加到这个有价值的基础上.Java语言被美国着名杂志PC?Magazine评为1995年十大优秀科技产品(计算机类仅此一项人选)之一,随之大量出现了用Java编写的软件产品,受到工业界的重视与好评,认为"Java是八十年代以来计算机界的一件大事".Java语言是一种适用于网络编程的语言,它的基本结构与c++极为相似,但却简单得多.它集成了其它一些语言的特点和优势,又避开了它们的不足之处.它具有简单,面向对象,稳定,平台独立,解释型,多线程,动态等主要特点.还有高性能,分布性,强大性,解释性,可移植性等.二,设计过程整体设计过程中我使用了JDBC——JA V A数据库连接.们在这简单地说,就是JDBC能完成3件事:(1)与一个数据库建立连接;(2)向数据库发送SQL语句;(3)处理数据库返回的结果;系统可以采用任何一种流行的,Java支持的操作系统,本系统一个用Access设计的数据库的数据表中.在Access数据库中,数据表名称为"词典内容",表中有2个字词典,所以,用户在使用或者运行的过程中应该按照英语单词查询.Importjava.awt.;.:Importjava.sq1.;Importjava.awt.event.; ClassDataWindowextendsFrameimplementActionListener {TextHeldenglishtext;TextAreachinesetext;Buttonbutton; DataWindow(){super("英汉小词典");setBackground(Color.cyan);setBounds(150,150,300,12o);setVisible (true);englisbtext=newTextField(16);chinesetext=newTextArea(5,1o); button=newButton("确定");panelpl=newPanel(),p2=newPanel(),p1.add(newLabe1("输入所要查询的英语单词:"));p1.add(eng—lishtext);p2.add(button);add(p1,"North");addS2,"South");add(chinesetext,"Center"); chinesetext.setBackground(Color.pink);button.addActionListener(this); addWindowListenenewWindowAdapter0 {publicvoidwindowClosing(WindowEvente){setVisible(false);System.exit(0);}1); publicvoidactionPerformed(ActionEvente)I遗e.getSourceo==button){chinesetext.setText0;}Catch(SQLExceptionec){}PublicvoidListstudent0throwsSQLException {Stringcname,ename;try{Class.forName("sun.jdbc.osbcJdbc0dbcDriner");}catch(ClassNotFoundExceptione);{)ConnectionEx1con=DriverManager.getConnection(''jdbc:adbc: test","gxy","ookk");StatementExlStmt=ExlCon.createStatement0;ResultSetrs=ExlStmt.executeQuery("SELECTFROM词典内容");While(rs.nextO){ename=rs.getString("单词");cname--rs.getString("解释");if(ename.equals(englishext.getText0)){chinesetext.append('kn'+cname);break;}ExlCon.close0;if(chinesetext.getText0.trimO.equ~e("查询结果")){chinesetext.append('kn'+"没有此单词");} publicclassDatabaseTest{publicstaticvoidmain(StringargsH),{DataWindowwindow=newDataWindowO;window.pack0;三,运行界面分,第一部分显示"输入要查询的英语单词:",有一空白文本框让后,可以单击"确定"按钮.Java自问世以来,以其得天独厚的优势,在IT业界掀起了研究,件无关的,"编写一次,到处运行"的高级语言和计算平台,Java天生就具有将网络上的各个平台连成一体的能力,真正实现了"网络就是计算机"的理念.以Java为代表的网络的成长,改变了我们的一场类似印刷术的重大变革.毫无疑问,它将影响人类社会的发展.Java是当今IT产业和人类文明的创新和希望!参考文献:[I】(美)DavidM.GearyJava2.Java2图形设计卷二:Swing编程思想;(美) BruceEekdUNIX网络编程(第一卷).[2]耿祥义,张跃平着.王克宏审java2实用教程(修订).清华大学出版社, 2o01.59。
最新JAVA开发常用英语词汇

JAVA开发常用英语词汇public['pʌblik] 公共的,公用的 static['stætik] 静的;静态的;静止的void:[vɔid] 空的 main:[mein] 主要的重要的class:[klɑ:s] 类 system:['sistəm] 系统方法out:[aut] 出现出外 print:[print ] 打印eclipse:[i'klips] java编程软件 string:[striŋ] 字符串类型double:['dʌbl] 双精度浮点型 int:[int] 整型char:[tʃɑ:] 字符型 scanner:['skænə] 接收输入integer:['intidʒə]整数整型 type:[taip]类型boolean:['bu:li:ən] 布尔类型真假二值 true:[tru:]真false:[fɔ:ls]假不正确的 if:[if] 如果else:[els] 否则 simple:['simpl] 简单单一体case:[keis] 实例框架 default:[di'fɔ:lt] 或者switch:[switʃ] 判断语句 break:[breik] 退出match:[mætʃ] 匹配 assess:[ə'ses] 评估exception:[ik'sepʃən] 异常 equals:['i:kwəls]判断两个字符串是否相等while:[hwail] 循环 index:['indeks] 下标bug:[bʌg] 缺陷 debug:[di:'bʌg] 调试step:[step] 步骤 error:['erə] 错误answer:['ɑ:nsə] 答案回答 rate:[reit] 比率young:[jʌŋ] 年轻的 schedule:['skedʒul] 表清单negative:['negətiv] 否定的 customer:['kʌstəmə] 顾客买主birthday:['bə:θdei] 生日 point:[pɔint] 分数得分continue:[kən'tinju:] 进入到下一个循环 return:[ri'tə:n] 返回(值)schedule:['skedʒul] 表清单 total:['təutl] 总人数,,全体的array:[ə'rei] 数组 length:[leŋθ] 长度sort:[sɔ:t] 分组排序 primitive:['primitiv] 初始的简单的reference:['refərəns] 参照证明关系 info:['infəu] 通知报告消息interface:['intəfeis] 接口 random:['rændəm] 随机数insert:[in'sə:t] 插入嵌入 compare:[kəm'pɛə] 比较对照ignore:[ig'nɔ:] 忽视不理会 triangle:['traiæŋgl] 三角形invert:[in'və:t] 使转位倒转 diamond:['daiəmənd] 菱形password:['pɑ:swə:d] 密码口令 change:[tʃeindʒ] 交换互换password:['pɑ:swə:d] 口令密码 administrator:[əd'ministreitə] 管理员initial:[i'niʃəl] 开始的最初的 class:[klɑ:s] 类object:['ɔbdʒikt] 物体对象 return:[ri'tə:n 返回encapsulation:[in,kæpsju'leiʃən] 封装 null:[nʌl] 空的person:['pə:sn] 人 start:[stɑ:t] 开始menu:['menju:] 菜单 login:[lɔg'in] 注册登陆main:[mein] 主要的 document:['dɔkjumənt] 文档display:[di'splei] 显示 method:['meθəd] 方法条理version:['və:ʃən] 译文版本 orient:['ɔ:riənt] 东方的parameter:[pə'ræmitɚ] 参数 since:[sins] 自…..之后calculator:['kælkju,leitə] 计算 shape:[ʃeip] 形状open:[əup] 开放 change:[tʃeindʒ] 交换互换date:[deit] 日期日子 research:[ri'sə:tʃ] 研究调查triangle:['traiæŋgl] 三角形 practice:['præktis] 练习loan:[ləun] 借出借给 operator:['ɔpə,reitə] 操作员protect:[prə'tekt] 保卫护卫 private:['praivit] 私人的私有的manage:['mænidʒ] 控制 search:[sə:tʃ] 搜寻查找upper:['ʌpə] 上面的 equal:['i:kwəl] 相等的ignore:[ig'nɔ:] 忽视驳回 lower:['ləuə] 较低的下部的last:[lɑ:st] 最后的 trim:[trim] 切除修改缩减buffer:['bʌfə] 缓冲储存器 final:['fainl] 最后的最终的score:[skɔ:]成绩 price:[prais]价钱test:[test]测试、实验 demo:['deməu]样本sum:[sʌm] 和 num:[nʌm] 数字height:[hait] 身高 weight :[weit] 体重music:['mju:zik] 音乐 computer:[kəm'pju:tə] 电脑student:['stju:dənt] 学生 total:['təutl] 总计的,总括的,全体的max 最大的 min 最小的avg 平均分 Add 加Minus 减 multiply:['mʌltiplai] 乘divide:[di'vaid] 除 Monday:['mʌndei] 星期一Tuesday:['tju:zdi] 星期二 Wednesday:['wenzdi] 星期三Thursday:['θə:zdi] 星期四 Friday:['fraidi] 星期五Saturday:['sætədi] 星期六 Sunday:['sʌndi] 星期日月份+缩写一月:January Jan. 二月:February Feb. 三月:March Mar. 四月:April Apr.五月:May –六月:June –七月:July –八月:August Aug. 九月:September Sept. 十月:October Oct. 十一月:November Nov. 十二月:December Dec 春spring 夏 summer秋 autumn(fall) 冬 winter项目常用单词argument 参量 abstract 抽象ascent 提升 already 已经API(Application Programming Interface)应用程序接口byte 字节 Boolean 布尔banana香蕉 base 基础buffer缓冲器 button 按钮break 中断 body 身体color 颜色 class 类count 计数 client 客户code 代码 calculation 计算cell 单元 circle圆capital首都 catch捕获check 检查 container容器component 组件 command 命令cube立方,三次方 char(=character)字符cancel取消 case 情况choice选择 click单击center 中心 compile编译clone克隆,复制 continue 继续create建立 draw 绘图data数据 demo 示例 DLL(Dynamic Link Library)动态链接库document 文档 descent 继承division 分裂,除法 define定义,说明display显示 error 错误extends 扩展 executed 执行event 事件 enter 输入,回车键exception 异常 except 除外employee 雇员 environment环境east 东方 equal 相等float 单精度型 fruit 水果file 文件 find 发现found 发现 field 域final 终结的 friend 朋友fill 填充 focus 焦点font 字体 factorial 阶乘graphic 图像 grid 方格GUI图形化用户接口 get 得到host 主机 height 高度init(=initialize)初始化 input 输入implement 实现 instance 实例io(=input/output)输出输入 interrupted 中断int(=integer)整型 item元素interface 接口 inner 内部的import 导入 index 索引Java 爪哇 JDK(JavaDevelopment Kit) Java开发工具JSP(Java Server Page) Java服务页 JVM(Java VirtualMachine) Java虚拟机Kit 工具 image 图像language 语言 loop 循环long 长整型 label 标签layout 布局 list 列表listener 收听者 move 移动menu 菜单 mode 模式method 方法 metric 米的,公尺motion 运动 manager 经理main 主要的 msg(=message) 消息new 新的 number 数字north 北方 native 本地的override 过载 orange 橘子output 输出 object 对象out 外部的 state 状态public 公共的 protected保护的private 私有的 property 属性point 点 price 价格problem 问题 package 打包,包裹print 打印 path 路径polygon 多边形 program 程序prompt 提示 parse 分析press 按,压 panel 面板paint 画 return 返回runnable 可运行的 radius 半径round 环绕 release 释放rect(=rectangle)长方形 radio 无线电resolve 解析 short 短整型south 南方的 string 字符串static 静态的 system 系统seed 种子 seasonal 季节的set 设置 super 超级square 平方,二次方 sub 替代的screen 屏幕 sound声音salary 薪水 sleep 睡觉size 大小,尺寸 start 开始sort 排序 status 状态synchronize 同步发生 switch 开关stream 流 symbol 符号true 真的 title 标题type 类型 temp(=temporary)暂时的throw 扔 thread 线程temperate 温度 tool 工具try 试图 undefined 未定义UI(UserInterface) 用户接口 update 更新volatile 挥发性 visible 不可见的virtual 虚拟的 variable 变量value 数值 void 无返回值的colume 列 viewer 观察者vector 矢量 URL(Uniform Resource Locator) 统一资源定位器Database 数据库 table 数据表Border 边框 padding 内边距Margin 外边距 float 浮动、漂浮clear 清除、清理 position 位置、定位。
java编程常用英语词汇

java编程常用英语词汇Java Programming Common English VocabularyJava is a popular programming language widely used for developing various applications and systems. As a programmer, it is essential to have a good understanding of the common English vocabulary used in the Java programming language. This article will introduce and explain frequently used Java programming terms in English.1. ClassIn Java, a class is a template or blueprint for creating objects. It defines the properties (variables) and functionalities (methods) of an object. Classes are used to create multiple objects that share similar characteristics.2. ObjectAn object is an instance of a class. It represents a real-world entity with its own set of properties and behaviors. Objects are created from a class and can interact with each other through methods.3. MethodA method is a set of instructions or code that performs a specific task. It is also known as a function in other programming languages. Methods are defined inside a class and can be reused and called multiple times throughout the program.4. VariableA variable is a named container used to store data in a program. It has a specific data type and can hold different values during the execution of the program. Variables provide a way to manipulate and reference data within the program.5. Data TypeIn Java, every variable has a data type that determines the type of data it can hold. The common data types in Java include integers (int), floating-point numbers (float, double), characters (char), booleans (boolean), and strings (String).6. LoopA loop is a control structure used to repeat a block of code multiple times. It allows the programmer to execute a set of statements repeatedly until a certain condition is met. The three main types of loops in Java are the for loop, while loop, and do-while loop.7. Conditional StatementA conditional statement is used to make decisions in a program based on certain conditions. It allows the program to execute different sets of instructions depending on the outcome of a condition. The if-else statement and switch statement are commonly used conditional statements in Java.8. InheritanceInheritance is a mechanism in Java that allows a class to inherit properties and methods from another class. It promotes code reusability and supports the concept of parent and child classes. Inheritance is implemented using the extends keyword in Java.9. PolymorphismPolymorphism allows objects of different classes to be treated as objects of a common superclass. It enables a single interface to be used for multiple implementations. Polymorphism in Java is achieved through method overriding and method overloading.10. Exception HandlingException handling is a mechanism used to catch and handle errors or exceptional situations that occur during program execution. It allows the programmer to handle errors gracefully and prevents the program from crashing. The try-catch block is used to handle exceptions in Java.11. InterfaceAn interface is a collection of abstract methods that define a contract for classes to implement. It specifies the behavior that a class should provide but does not provide any implementation details. To implement an interface, a class must use the implements keyword in Java.In conclusion, these are just a few of the many English vocabulary terms commonly used in Java programming. Mastering these terms will greatly enhance your understanding of the language and help you become a proficient Java programmer.。
java 编程常用英语单词 解释

abstract (关键字) 抽象['æbstrækt]access vt.访问,存取['ækses]'(n.入口,使用权)algorithm n.算法['ælgәriðm]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'niʃәlaiz]instanceof (关键字) 运算符,用于引用变量,以检查这个对象是否是某种类型。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
import java.awt.*;import .*;import java.sql.*;import java.awt.event.*;import java.io.*;import java.util.Calendar;class DataWindow extends Frame implements ActionListener{ TextField searchWord_tField,expWord_tField,searchChineseField,expEnglishField,updWord_tField,updExpWord_tField,addNewWord_tField,addExpWord_tField;Button search_button,update_button,add_button,searchChinese_buton;int search_record=0;Connection Con=null;Statement Stmt=null;DataWindow(){ super("英汉小词典");setBounds(150,150,600,400);setVisible(true);message_log("DataWindow Start : ");try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");}catch(ClassNotFoundException e){}try{Con=DriverManager.getConnection("jdbc:odbc:data","lixuanxian","123");Stmt=Con.createStatement();message_log("Stmt="+Stmt);}catch(SQLException ee) {}searchWord_tField=new TextField(16);expWord_tField=new TextField(16);searchChineseField=new TextField(16);expEnglishField=new TextField(16);updWord_tField=new TextField(16);updExpWord_tField=new TextField(16);addNewWord_tField=new TextField(16);addExpWord_tField=new TextField(16);searchChinese_buton=new Button("确定");search_button=new Button("查询");update_button=new Button("更新");add_button=new Button("添加");Panel p1=new Panel(),p2=new Panel(),p3=new Panel(),p4=new Panel(),pset=new Panel(new GridLayout(5,2));p1.add(new Label("输入要查询的英语单词:"));p1.add(searchWord_tField);p1.add(new Label("显示英语单词的汉语解释:"));p1.add(expWord_tField);p1.add(search_button);p4.add(new Label("输入要查询的汉语:"));p4.add(searchChineseField);p4.add(new Label("显示英语单词的英文解释:"));p4.add(expEnglishField);p4.add(searchChinese_buton);p2.add(new Label("输入英语单词:"));p2.add(updWord_tField);p2.add(new Label("输入该单词更新的汉语解释:"));p2.add(updExpWord_tField);p2.add(update_button);p3.add(new Label("输入英语单词:"));p3.add(addNewWord_tField);p3.add(new Label("输入汉语解释:"));p3.add(addExpWord_tField);p3.add(add_button);pset.add(p1);pset.add(p4);pset.add(p2);pset.add(p3);add(pset);search_button.addActionListener(this);update_button.addActionListener(this);add_button.addActionListener(this);searchChinese_buton.addActionListener(this);addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e){ setVisible(false);System.exit(0);}});}public void actionPerformed(ActionEvent e){if (e.getSource()==search_button){search_record=0;try { query();}catch (SQLException ee) {}}else if (e.getSource()==update_button){try { modify();}catch (SQLException ee) {}}else if (e.getSource()==add_button){try { addNew();}catch (SQLException ee) {}}else if (e.getSource()==searchChinese_buton){try { queryChinese();}catch (SQLException ee) {}}}public void query() throws SQLException{message_log("query start");String cname, ename,text="'"+searchWord_tField.getText().trim()+"'";Con=DriverManager.getConnection("jdbc:odbc:data","lixuanxian","123");message_log("Con="+Con);ResultSet rs=Stmt.executeQuery("SELECT * FROM dict where English="+text);int n=0;message_log("in query : n="+n);while (rs.next()){message_log("while start " );ename=rs.getString("English"); cname=rs.getString("Chinese");message_log(ename+" "+cname);if(ename.trim().equals(searchWord_tField.getText().trim())){message_log("equal");message_log("in query : ename="+ename+" cname="+cname);expWord_tField.setText(cname);search_record=1;break;}message_log("not equal");}if(search_record==0){expWord_tField.setText("没有该单词");}}public void queryChinese() throws SQLException{message_log("queryChinese start");String cname, ename,text="'"+searchChineseField.getText().trim()+"'";Con=DriverManager.getConnection("jdbc:odbc:data","lixuanxian","123");message_log("Con="+Con);ResultSet rs=Stmt.executeQuery("SELECT * FROM dict where Chinese="+text);int n=0;message_log("in query : n="+n);while (rs.next()){message_log("while start " );ename=rs.getString("English"); cname=rs.getString("Chinese");message_log(cname+" "+ename);if(cname.trim().equals(searchChineseField.getText().trim())){message_log("equal");message_log("in query : cname="+cname+"ename="+ename);expEnglishField.setText(ename);search_record=1;break;}message_log("not equal");}if(search_record==0){expEnglishField.setText("没有该词语");}}public void modify() throws SQLException{message_log("modify start");String s1="'"+updWord_tField.getText().trim()+"'",s2="'"+updExpWord_tField.getText().trim()+"'";String temp="UPDATE dict SET Chinese=" +s2+" WHERE English= "+s1;Con=DriverManager.getConnection("jdbc:odbc:data","lixuanxian","123");Stmt.executeUpdate(temp);updWord_tField.setText(null);updExpWord_tField.setText(null);Con.close();}public void addNew() throws SQLException{message_log("addNew start");String s1="'"+addNewWord_tField.getText().trim()+"'",s2="'"+addExpWord_tField.getText().trim()+"'";String temp="INSERT INTO dict VALUES("+ s1+", "+s2+")";Con=DriverManager.getConnection("jdbc:odbc:data","lixuanxian","123");Stmt.executeUpdate(temp);addNewWord_tField.setText(null);addExpWord_tField.setText(null);Con.close();}public void message_log(String msg){try {java.util.Date RightNow = Calendar.getInstance().getTime();java.text.SimpleDateFormat LOG_FILENAME_SDF=new java.text.SimpleDateFormat("yyyyMMdd");java.text.SimpleDateFormat SMS_LOG_DETAIL_TIME=new java.text.SimpleDateFormat("yyyy/MM/dd HH:mm:ss ");// get the Log File LocationFileOutputStream fos;fos = new FileOutputStream("F:\\李选贤\\java\\英汉小词典\\log\\"+LOG_FILENAME_SDF.format(RightNow) + "_Database.log" ,true);PrintWriter pw = new PrintWriter(fos);pw.print(SMS_LOG_DETAIL_TIME.format(RightNow));pw.println(" " + msg);pw.close();fos.close();} catch (Exception ex) {System.out.println(msg);System.out.println("SMSMsgLog: Error \r\n"+ex.getMessage());ex.printStackTrace();}}}public class dictionary{public static void main(String args[]){DataWindow window1=new DataWindow();window1.pack();}}。