Chapter 8 object oriented programming

1. Package Package is a way to organize classes; The main purpose of using packages is to ensure the uniqueness of classes; For example, if you write a Test class in your code, then your colleagues may also write a Test class. If two classes with the same name appear, they will conflict and the code cannot be compiled. 1.1 import class ...

Posted on Mon, 22 Nov 2021 09:36:12 -0500 by gljaber

Abstract classes and interfaces in java (often tested in interviews, important)!!

abstract class rule of grammar In the example of polymorphic code about Shape, we find that the draw method in the parent class Shape does not seem to have any actual work, and the main drawing graphics are completed by the draw methods of various subclasses of Shape. Like this method without actual work, we can design it as an abstract m ...

Posted on Wed, 29 Sep 2021 18:23:15 -0400 by jjbarnone