Java record-21-Access Controller
Java access Controller access modifier (access modifier) 1 ). public: attributes and Methods Modified by public can be accessed by all classes; 2 ). protected: the attributes and Methods Modified by protected can be accessed inside the class, the same package, and the subclass of the class. 3 ). private: attributes and Methods Modified by private can only be used within this class; 4 ). default (without any access modifier): used by the class inside the class and under the same package; instanceof: determines whether an object is an instance of a class. Syntax format: Reference instanceof Class Name (interface name), return a boolean value. People people = new Man (); System. out. println (people instanceof People); the result is true, because Man is a subclass of People, according to inheritance, the subclass is the parent class, so Man can also be seen as an instance of People. Equality comparison (=): 1 ). for the native data type, compare whether the values of the left and right sides are equal; 2 ). for the reference type, compare whether the reference on both sides points to the same object, or whether the reference addresses on both sides are the same.