實驗8 繼承與多態 8.1 實驗目的 (1) 理解類的繼承,掌握變量隱藏、方法覆蓋的概念。 (2)理解引用類型的變量的賦值轉換原則。 (3)理解多態概念,掌握方法的匹配調用原則; (4)理解抽象類與接口的使用; (5)理解this和super的含義及使用。 (6)理解訪問控制符的使用 8.2 知識要點 8.2.1 繼承的概念 通過類的繼承,祖先類的所有成員均將成為子類擁有的“財富”。但是能否通過子類對象直接訪問這些成員則取決于訪問權限設置。Object類是所有類的祖先。 8.2.2 構造方法與繼承關系 構造方法不存在繼承關系,子類中是如何給父類繼承的屬性賦初值呢? 子類通過調用父類的構造方法給父類的屬性賦值,在子類的構造方法的第1行可以通過super去調用父類的構造方法,如果沒有super調用,則默認調用父類的無參構造方法。所以,在父類中編寫構造方法通常均要提供無參構造方法。 8.2.3 對象引用變量賦值原則 可以將子類的對象引用賦值給父類引用變量,由于父類能操作訪問屬性和方法的子類已全部繼承。但將父類引用變量的值賦給子類引用變量就受到限制,必須進行強制轉換,編譯總是認可強制轉換,但運行程序時如果不能正確轉換就會報錯。
上傳時間: 2016-08-05
上傳用戶:baiom
sql equipment management system for the Institute of Laboratory office automation management system an important part of it can lend to the return of the equipment scrapped and a new standardized management, thereby increasing efficiency and avoiding waste of resources. background database using Access, prospects of development tools using Visual Basic. The system uses ADO data access technology, and each database table and operation of the field to the type of package, which succeeded in Object-oriented programming thinking applied to the database application design.
標簽: management system Laboratory automation
上傳時間: 2016-08-15
上傳用戶:784533221
Visual tracking is one of the key components for robots to accomplish a given task in a dynamic environment, especially when independently moving Objects are included. This paper proposes an extension of Adaptive Visual Servoing (hereafter, AVS) for unknown moving Object tracking. The method utilizes binocular stereo vision, but does not need the knowledge of camera parameters. Only one assumption is that the system need stationary references in the both images by which the system can predict the motion of unknown moving Objects. The basic ideas how we extended the AVS method such that it can track unknown moving Objects are given and formalized into a new AVS system. The experimental results with proposed control architecture are shown and a discussion is given.
標簽: components accomplish tracking dynamic
上傳時間: 2013-12-11
上傳用戶:lizhen9880
Java MP3 Player, Here s a list of features: - Reads, creates, updates, and removes id3v2.3 and id3v2.4 tags - Reads, creates, updates, and removes id3v1 tags - Extracts MPEG data such as bit rate, sample rate, channel mode, etc. - Calculates playing time of mp3 from mpeg information (no good w/VBR) - Can read and create Winamp styled playlists - Offers other utility classes such as MP3FileFilter and MP3Comparator - NullsoftID3GenreTable Object keeps a list of genres for you and can automatically determine the id3v1 genre from an id3v2 string or the other way around
標簽: and features creates updates
上傳時間: 2014-11-21
上傳用戶:qq521
This sample displays a basic integer calculator powered by the 8051 microcontroller. Although Keil C51 has a full floating point math library the evaluation version is restricted to 2k of Object code, so we have constrained this sample to integer maths in order to fit within this limit. The program for this design was written in C using the Keil uVision 2 IDE for which Proteus VSM provides a Debug Monitor driver. Instructions for configuring Proteus to run in conjunction with the Keil environment can be found by editing the 8051 microcontroller on the schematic (point at it and press CTRL-E) and then clicking on the help button on the Edit Component dialogue form.
標簽: microcontroller calculator Although displays
上傳時間: 2014-12-01
上傳用戶:edisonfather
For advanced geometry, most apps will prefer to load pre-authored meshes from a file. Fortunately, when using meshes, D3DX does most of the work for this, parsing a geometry file and creating vertx buffers for us. This tutorial shows how to use a D3DXMESH Object, including loading it from a file and rendering it. One thing D3DX does not handle for us is the materials and textures for a mesh, so note that we have to handle those manually.
標簽: pre-authored Fortunately advanced geometry
上傳時間: 2013-12-26
上傳用戶:sssl
是一本介紹java基礎應用的好書 Java For Artists targets both the undergraduate computer science or information technology student and the practicing programmer. It is both an introductory-level textbook and trade book. As a textbook it employs learning Objectives, skill-building exercises, suggested projects, and self-test questions to reinforce the learning experience. The projects offered range from the easy to the extremely challenging. It covers all the topics you’d expect to find in an introductory Java programming textbook and then some. As a trade book it goes purposefully deeper into topics cut short or avoided completely in most introductory textbooks. Its coverage of advanced GUI programming techniques, network programming and Object-oriented theory will enable you to take your skills to a higher level.
標簽: undergraduate information computer Artists
上傳時間: 2016-09-28
上傳用戶:qiaoyue
Aspect-Oriented Software Developement Coverage includes Using AOSD to streamline complex systems development without sacrificing flexibility or scalability How AOSD builds on the Object-oriented paradigmand how it s different State-of-the-art best practices for the AOSD development process Languages and foundations: separating concerns, filter technologies, improving modularity, integrating new features, and more Using key AOSD tools, including AspectJ, Hyper/J, JMangler, and Java Aspect Components Engineering aspect-oriented systems: UML, concern modeling and elaboration, dependency management, and aspect composition Developing more secure applications with AOSD techniques Applying aspect-oriented programming to database systems Building dynamic aspect-oriented infrastructure
標簽: Aspect-Oriented Developement streamline Software
上傳時間: 2013-12-01
上傳用戶:jennyzai
This GLib version 2.16.1. GLib is the low-level core library that forms the basis for projects such as GTK+ and GNOME. It provides data structure handling for C, portability wrappers, and interfaces for such runtime functionality as an event loop, threads, dynamic loading, and an Object system.
標簽: GLib the low-level projects
上傳時間: 2013-12-19
上傳用戶:tb_6877751
學會一個程序語言,是一回事兒;學會如何以此語言設計并實作出有效的程序,又是一 回事兒。C++ 尤其如此,因為它很不尋常地涵蓋了罕見的威力和豐富的表現力,不但建立 在一個全功能的傳統語言(C)之上,更提供極為廣泛的對象導向(Object-oriented)性質, 以及對templates 和exceptions(異常狀態)的支持。 Lostmouse編寫的非常出名的C++學習資料,適用于有一定的C++編程經驗的同學。
上傳時間: 2014-11-27
上傳用戶:qunquan