菜单
  
    Language Overvie As we stated earlier,Java is based on C++ but was specifically designed to be smaller,simpler,and more reliable. Java has both types and classes. The primitive types are not objects based on classes. These include all of its scalar types, including those for integer,floating-point,Boolean,and character data.Objects are accessed through reference variables,but primitive type values are accessed exactly as the scalar values in purely imperative language like C and Ada 83.Java arrays are instances of a predefined class,whereas in C++ they are not ,although many C++ users build wrapper classes for arrays to add features like index range checking,which is implicit in Java.40843
    Java does not have pointers,but its reference types provide some of the capabilities of pointers.These references are used to point to class instance,in fact,that is the only way class instances can be referenced.All objects are allocated on the heap.While pointers and references may seem a great deal alike,there are some important semantic differences.Pointers point to memory locations,but references point at objects.This makes any kind of arithmetic on references nonsense,eliminating that error-prone practice.The distinction between a pointer’s value and the value to which it points is the responsibility of the programmer in many languages,in which pointers sometimes must be explicitly dereferenced.References are always implicitly dereferenced,when necessary.So they behave more like ordinary scalar variables.
    Java has a primitive Boolean type,used mainly for the control expressions of ints control statements(such as if and while).Unlike C and C++,arithmetic expressions cannot be used for control expressions.Java has no record,union,or enumeration types.
    One significant difference between Java and many of its contemporaries that support object-oriented programming,including Ada 95 and C++,is that it is not possible to write stand-alone subprograms in Java.All Java subprograms are methods and are defined in classes.There is no construct in Java that is called a function or a subprogram.Furthermore,methods can only be called through a class or object.
    Another important difference between C++ and Java is that C++ supports multiple inheritance directly in its class definitions.Some feel multiple inheritance leads to more complexity and confusion than it is worth.Java supports only single inheritance,although some of the benefits of multiple inheritance can be gained by using its interface construct.
    Java includes a relatively simple form of concurrency control through its synchronize modifier,which can appear on methods and blocks.In either case,it causes a lock to be attached.The lock insures mutually exclusive access or execution.In Java it is relatively easy to create concurrent processes,which in Java are called threads.
    Java used implicit storage deallocation for its object,often called ‘garbage collection’.This frees the programmer from being concerned with putting storage back in the heap when it is no longer needed.Programs written in language that require explicit deallocation often suffer from what is sometimes called memory leakage,which means that storage is allocated but never deallocated.This can obviously lead to eventual depletion of all available storage.
    Unlike C and C++,Java includes assignment type coercions (implicit type conversions ) only if they are widening (form a “smaller” type to a “larger” type).
    Java in the memory allocation is dynamic, it uses object-oriented mechanism and the actual memory will be with the operation of the program. Program to run in the Java system automatic memory were scanned as long-term unused space of "garbage collection, so that system resources are more fully utilized. According to this mechanism, programmers do not have to pay close attention to the problem of memory management, which makes Java programming makes it simple and clear, and avoid the errors due to memory management and lead to system problems.
  1. 上一篇:酒店业的管理创新英文文献和中文翻译
  2. 下一篇:云计算英文文献及中文翻译
  1. ADO.NET结构与概述英文文献和中文翻译

  2. VisualBasic语言与算法英文文献和中文翻译

  3. JAVA语言英文文献和中文翻译

  4. Java编程语言英文文献和中文翻译

  5. 电-气动驱动的垂直计算机...

  6. 金属板料冲压模具计算机...

  7. JSP技术概述英文文献和中文翻译

  8. g-C3N4光催化剂的制备和光催化性能研究

  9. 巴金《激流三部曲》高觉新的悲剧命运

  10. 上市公司股权结构对经营绩效的影响研究

  11. 中国传统元素在游戏角色...

  12. C++最短路径算法研究和程序设计

  13. 江苏省某高中学生体质现状的调查研究

  14. 浅析中国古代宗法制度

  15. 现代简约美式风格在室内家装中的运用

  16. NFC协议物理层的软件实现+文献综述

  17. 高警觉工作人群的元情绪...

  

About

优尔论文网手机版...

主页:http://www.youerw.com

关闭返回