![]() ![]() What is the use of the StudentDao interface? b. Parent-oriented programming makes programming easier and code more concise. (Note: you must combine your own code) Sorting is convenient, no need to write for direct calling. And briefly describe which class should implement the Comparable interface better? There are many methods for getArea(), so they are implemented in shape.ģ.5 Take the code you wrote in 3.4 as an example, briefly describe the benefits of programming for Comparable interfaces and programming for parent classes. ![]() Hope to use Arrays.sort to sort them, please write the corresponding code. The perimeter getPerimeter() and the area getArea() can be declared as abstract, and their specific implementation methods are different.ģ.4 There are many Shape type objects such as Rectangle and Circle. As long as public int compareTo(T o) is implemented, its function can be realizedģ.2 Combined with your code description in PTA 7-2, why do I need Comparator interface with Comparable interface? Comparator is to sort a single element, and comparable is to sort the entire object.ģ.3 In the previous jobs Shape, Rectangle, Cirlce, what method in the Shape class should be declared as abstract? Tell the reason. ![]() Comparable and Comparatorģ.1 Combining your code description in PTA 7-1, why a certain class implements the Comparable interface, so you can directly use Arrays.sort to sort the type of array? Comparable is a comparison and sorting between objects. What has changed is the method of input and output, and what has not changed is the specific implementation method of the game. Can be instantiated, there is a clear method does not need abstract.Ģ.3 Important: In this example, what has changed and what has not changed? Try to combine concepts such as abstract to illustrate. Methods with different implementations and those that are not clear should be declared as abstract. What kind of methods do you think should be declared as abstract in abstract classes, and what methods do not need to be declared as abstract can be implemented directly. ![]() There are abstract methods and non-abstract methods in java. What are the benefits of such a transformation? Use abstract classes in input and output, which can be implemented in the console or elsewhere.Ģ.2 GuessGame (after transformation). abstract: Read the design and use of the source code of the GuessGame abstract classĢ.1 The code before Guess's transformation is very simple, but the code after the transformation uses abstract classes and abstract methods, which looks more complicated. This time there is a major adjustment in the structure, and some methods have been adjusted to the categories. The idea is much clearer than last time, and the code is not only more complete and more concise than last time. 1.3 System overall class diagram Class diagram drawing reference materials:ġ.4 Screenshots of shopping carts, products, and system key codes (mainly intercept the parts that you are responsible for)ġ.5 Others: Compared with the last system, what are the changes to the system design? Other thoughts. Tip: In the XMind text box, you can press Shift+Enter to make the word stand up. 1.1 Project introduction table: Code Cloud memberġ.2 Framework of common functions of the system Object-oriented design assignments (team project, 2-3 people)Ĭontent: Continue to improve the last major homework. 1.3 Optional: Use conventional methods to summarize other lesson content. Note: Mind maps generally do not require too many words. 1.1 Write down the key knowledge points that you think are more important in this week's study interface comparable comparator interfaceġ.2 Try to organize these keywords using mind maps. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |