求一篇10000字符的关于java方面的英文文章,我们毕业论文要用。

another.It has all the flexibility of assembly code.Java doesn''t assume that you know what you are doing.It makes sure that you do.C++ pointers don'exist in Java.You can no longer access objects indirectly or by chance.You don't need to.You declare objects and reference tho...
求一篇10000字符的关于java方面的英文文章,我们毕业论文要用。
Applet举例。

源程序如下:

import java.awt.Graphics; //声明applet使用了java.awt包中的Graphics类

import java.applet.Applet; //声明applet使用了java.applet包中的Applet类

public class.MyApplet extends Applet{ //声明一个名为MyApplet的公共类,它继承了Applet类

public String s; //声明一个字符串

public void init( ){ //Applet的初始化方法

s = new String("Hello World !"); //创建一个字符串

}

public void paint(Graphics g){

g.drawString(s,60,40);

}

}

一、解释:

1、Graphics类使得Applet可以绘制直线、矩形、椭圆形、字符串等。此程序中,绘制了“Hello World!”字符串

2、方法init( )实现了字符串的创建

3、paint( )中,g为Graphics类的对象。它调用了Graphics的drawString方法绘制字符串。

4、drawString方法中的第一个参数是要绘制的字符串s,后面两个参数(60,40)说明了字符串左下角所在的平面坐标,60为横坐标,40为纵坐标。

5、Java的坐标系原点在左上角,纵轴正方向指向下方。坐标单位是像素。

二、编译源程序为Class文件

javac MyApplet.java

三、Applet中没有main( )方法作为Java解释器的入口,因此必须编写HTML文件,把Applet嵌入HTML文件中,然后用appletviewer来运行,或在支持Java的浏览器上运行HTML文件。HTML文件内容如下:

<html>

<head>

<title>My Applet</title>

</head>

<body>

<applet code=MyApplet.class width=400 height=100></applet>

</body>

</html>

Java provides all he luxuries of object-oriented programming:class

hierarchy,inheritance,encapsulation,and polymorphism--in a context that is truly useful and

efficient.

The main reason for developing object-oriented software,besides clarity and simplicity,is

the desperate hope that somehow the objects you develop will be reused.Java not only

encourages software reused.Java not only encourages software reuse,it demands it.To write

any sort of Java program,no matter how simple,you must build on the classes and methods of

the Java API.

Once you have begun developing software in Java,you have two choices:

● Build on the classes you have developed,thereby reusing them.

● Rewrite your software from scratch,copying and tailoring useful parts of existing

software.

With Java,the temptation to start from scratch is no longer appealing.Java's object-oriented

structure forces you to decelop more useful,more tailorable, and much simpler software the

first time around.

3.Java Is Safer and More Reliable

Java is safer to use than C++ because it keeps you from doing the things that you do

badly,while making it easier to do the things that you do well.

Java won't automatically convert data types.You have to explicitly convert from one class

another.C++,under the most undesirable conditions,will automatically convert one type to

another.It has all the flexibility of assembly code.Java doesn''t assume that you know what

you are doing.It makes sure that you do.

C++ pointers don'exist in Java.You can no longer access objects indirectly or by chance.You

don't need to.You declare objects and reference those objects directly.Complex pointer

arithmetic is avoided.If you need an indexed set of objects,you can use an array of

objects.The concept of "the address of an object" is eliminated from the programming errors

that go another assembly language dinosaur is laid to rest.As a result,it becomes much

easier to do things correctly on Java.

Java's reliability extends beyond the language level to the compiler and the runtime

system.Compile-time checks identify many programming errors that go undetected in other

progamming languages.These checks go beyond syntactic checking to ensure that statements are

semantically correct.

Runtime checks are also more extendsive and effective.Remember your teacher or mom telling

you to "Check your work twice to make sure it's right?"The Java linker understands class

types and performs compiler-level type checking,adding redundancy to reliability.It also

performs bounds checking and eliminates indirect object access,even under error conditions.

译文为:

JAVA提供了面向对象编程最有价值的一切:类的分级结构、继承、封装 和多态(动态绑定)——在真正意义上既可用又高效的(一切)。

开发面向对象软件的主要原因,除简明性之外,是基于一种极端希望,那就是你开发出的对象将会被重用。

JAVA不仅鼓励软件复用,更需要软件复用。编写任何JAVA软件,无论多简单,必须基于JAVA API提供的类和方法。

一旦你开始用JAVA开发程序,你有两个选择:

● 基于你已开发的类,即复用它们。

● 基于对已有软件可用部分的挖补、复制、修改,重写你的软件。

对于JAVA,从挖补开始已不再吸引人。JAVA的面向对象结构使你不得不从一开始就开发更好用,更易于修改而且更简单的软件。

3.JAVA更安全且更可靠

JAVA比C++使用起来更安全,因为它使你远离那些你容易弄糟的部分,同时使你擅长的部分变得更为容易。

JAVA不会自动转换数据类型,你必须显式的将一个类型转换为另一个。C++在最不愿意看到的情况下,会自动将一个类型转换为另一个。它拥有汇编语言代码的所有灵活性。JAVA不会假设你知道你在做什么。它会确保你知道。

C++指针在JAVA里不存在。你无法间接地或是随机地访问对象。(因为)你无需这样做。你声明对象并且直接访问它们,避免了复杂的指针运算。

如果你需要一些编号的对象,你可以使用一个对象数组。“一个对象的地址”这一概念,就像另外一只“汇编语言恐龙”(注:恐龙代表过时但顽固的东西)一样,从编程错误中消失。

所以,在JAVA里更容易把事情做对。

JAVA的可靠性从语言级别一直延伸到编译器和运行系统级别。

编译阶段可以检查出许多在别的语言(编译)中无法检查出的错误。这些检查不仅可以针对语法甚至可以保证语句在语义上的正确性。

运行中的检查也更高效且更具扩展性。想想你的老师和母亲总对你说:“检查你的作业两次来保证你做对了。” JAVA连接器理解类的类型并且进行编译器级的类型检查,增加了可靠性的冗余(检查)。而且它还会进行边界检查,甚至在出错的情况下,也会消除 间接对象访问。2011-05-17
mengvlog 阅读 7 次 更新于 2025-07-20 09:53:31 我来答关注问题0
  •  深空游戏 中国电信天翼宽带用户登录密码是多少?

    中国电信天翼宽带的用户登录密码因设备、地区及用户设置的不同而有所差异,因此无法给出统一的密码。一般来说,天翼宽带的初始密码可能是useradmin、admin或者光猫背面标注的默认密码,也可能是如nE7jA%5m这样的复杂密码。对于天翼宽带的用户而言,如果忘记了登录密码,有几种方法可以找回或重置密码:查看光...

  • anonymous 求一篇关于 免疫的 论文

    一、基因疫苗的诞生 自1796年英国医生琴娜(Jener)首次采用牛痘苗以来,疫苗已在世界范围内被广泛应用,200多年来各种疫苗已经帮助人类战胜了包括天花在内的多种传染病.然而,现有的疫苗主要有两种:第一种疫苗是传统疫苗,即弱毒活苗和灭活苗,如鸡新城疫弱毒苗,猪瘟灭活苗,它是直接将无毒或减毒的病...

  •  fct19 西部数据硬盘序号的问题,JA10001007473P是什么盘?

    “J”表示转速为7200 RPM/分,数据缓存为8MB的高端鱼子酱硬盘 。“G”表示为转速拥有10000 RPM/分,数据缓存为8MB的最高端桌面硬盘Raptor(猛禽)系列。第四部分表示接口类型。A--Ultra ATA66,B--Ultra ATA100,W表示应用于AV(数码影音)领域的硬盘,D表示为Serial ATA150接口 。附加编号部分 XX-X...

  •  唔哩头条 原神怎么永久兑换10000原石最全的兑换码

    1. 原神永久兑换码10000原石:WSRGQ4DSWQHELSQG94UTX8H2MB9YR5CG9XWJJSRG85VYQEX6BA9Z9LCZ9WDEPTQG8MUH8EHAFAQZ8MCHREG2FARGQ5UTGJ3SXSRH95CTHKKJGB8GRLVSGKJE9S9ZRLVTGJK63AQHQMCTZJ5S5S8YQ5VSBS8EYT8HQLUABT9JTBRY84CTSRAAUS8H84VTSBRN7A9YRMCBS9FWSS9SYKNHKLHSBV1uy4y1V7gMSBP53CLTBL...

  • minnaminmin 求一篇德语作文,关于德语学习的,90-110词即可,急

    1.Erschließung unbekannter Wörter Beim Lesen der fremdsprachigen Texte stoßen Sie immer wieder auf unbekannte Wörter. Sie brauchen nicht schon beim ersten unbekannten Wort ein Wörterbuch zu benutzen. Lesen Sie erst einmal weiter und entscheiden Sie: Ist...

檬味博客在线解答立即免费咨询

Java相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部