freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

java的面向?qū)ο缶幊掏馕馁Y料翻譯-其他專業(yè)(存儲版)

2025-02-28 06:30上一頁面

下一頁面
  

【正文】 概念。 一個子類的對象可以被當作其父類的對象來處理。但也應(yīng)認識到,子類通常擁有比父類更多的成員。 如果用子類來引用父類的對象,將報告一個語法錯誤。 很難讓學(xué)生意識到設(shè)計師和工業(yè)的大型軟件項目的實施者所面臨的問題。 附件 2:外文原文 (復(fù)印件) Java Objectoriented programming Objectoriented programming and its key ponent technologies as inheritance and polymorphism. Software reusability saves time in program development. It encourages reuse of proven and debugged highquality software, thus reducing problems after a system bees operational. These are exciting possibilities. Polymorphism e nables us to write programs in a general fashion to handle a wide variety of existing and yettobespecified related makes it easy to add new capabilities to a system. Inheritance and polymorphism are effective techniques for dealing with software plexity. When creating a new class, instead of writing pletely new instance variables and instance methods, the programmer can designate that the new class is to inherit the instance variables and instance methods of a previously defined superclass. The new class is referred to as a subclass. Each subclass itself bees a candidate to be a superclass for some future subclass. The direct superclass of a class is the superclass from which the class explicitly inherits (via the keyword extends). An indirect superclass is inherited from two or more levels up the class hierarchy. For example, class JApplet (package ) extends class Applet (package ). With single inheritance, a class is derived from one superclass. Java does not support multiple inheritance (as C++ does) but it does support the notion of interfaces. interfaces help Java achieve many of the advantages of multiple inheritance without the associated problems. We will discuss the details of interfaces in this chapter. We consider both general principles and a detailed specific example of creating and using interfaces. A subclass normally adds instance variables and instance methods of its own, so a subclass is generally larger than its superclass. A subclass is more specific than its superclass and represents a smaller, more specialized group of objects. With single inheritance, the subclass starts out essentially the same as the superclass. The real strength of inheritance es from the ability to define in the subclass additions to, or replacements for, the features inherited from the superclass. Every subclass object is also an object of that class’s superclass. For example, every applet we have defined is considered to be an object of class JApplet. Also, because JApplet extends Applet, every applet we have defined is considered to be an Applet. This information is critical when developing applets, because an applet container can execute a program only if it is an Applet. Although a subclass object always can be treated as one of its superclass types, superclass objects are not considered to be objects of their subclass types. We will take advantage of this “subclassobjectisasuperclassobject” relationship to perform some powerful manipulations. For example, a drawing application can maintain a list of shapes to display. If all the shape types extend the same superclass directly or indirectly, the drawing program can store all the shapes in an array (or other data structure) of superclass objects. As we will see in this chapter, this ability to process a set of objects as a single type is a key thrust of objectorien
點擊復(fù)制文檔內(nèi)容
黨政相關(guān)相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1