----------------------------------------------------------------------------------------------------------------------------------------------- 本文提示:《关于java面向对象的编程》是本站编辑们为广大网友精选的实用文章,本文阐述了关于文章的相关理论,相对来说专业性强,但是本文只是针对于某个问题提出的见解与论述,未必能辐射到相关问题的方方面面,所以本文处理问题的方法仅仅为您提供一些参考。更多问题请查阅学习中国网其他栏目哦. -----------------------------------------------------------------------------------------------------------------------------------------------
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. www.xuexi86.com
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提供他的所有奢侈品的面向对象编程:类层次,继承,封装,多态--在一个方面,是真正有用和有效. 主要原因为发展对象的软件,除了清晰,简洁,是绝望的希望某种物体,你会发展 被reused.java不仅鼓励软件reused.java不仅鼓励软件重用的,它要求it.to写任何形式的Java程序,不 多么简单,你必须建立在阶级和方法的Java API的. 一旦你已经开始开发软件,在Java中,你有两个选择: ●建立的班,你有新的发展,从而重用他们. ●重写你的软件从无到有,复印及剪裁有用的部分现有软件. 用JAVA的诱惑从零开始不再appealing.java的面向对象结构逼着你decelop更加有用,更有tailorable , 更为简单的软件首次左右. 3.java更安全和更可靠的,是Java的安全性比使用C++的,因为它使你做的 事情是你做得不好,很容易做的事,你能做得好. 爪哇不会自动转换数据types.you已明确把从一个阶级another.c +下,最不良的情况下,会自动转换 一类为another.it一直灵活性大会code.java doesn''t假设你知道你doing.it 使得相信你. C++指针don'exist在java.you再也获取物体或间接由chance.you不需要to.you申报对象和 参考这些物体directly.complex指针算术是avoided.if你需要检索的对象,你可以使用数组 离心力的概念"的地址是一个对象" ,是淘汰的编程错误,再走一个汇编语言恐龙是L 援助rest.as结果,就变得很容易做正确的Java实现. JAVA的可靠性超越了语言水平的编译和运行system.compile时间检查找出许多编程错误 不停地在其他编程languages.these检查超越句法检查,以确保报表是语义正确的. 运行检查,也更extendsive effective.remember和你的老师或妈妈告诉你: "检查你的工作两次 要把它吗? "爪哇理解连接类类型,并执行编译级别类型检查,加入冗余可靠性,还进行式 遏制和消除间接物体接触,即使在误差条件. 收藏到:[收藏夹] [百度搜藏] [新浪ViVi] [POCO网摘] [ 和讯网摘] [好哦网摘] [Google书签] [Yahoo书签] [搜狐网摘] [365Key网摘] [天极网摘] [我摘] [博采网摘] [igooi网摘] |