Field table CollectionThe parsing of this class file is a bit too long to parse. The above describes the magic number, minor version number, motherboard number, constant pool entry, constant pool, access flag, class index, parent class index, and
Work for a long time, but found that the usual mechanical development, it seems that very little use of OOP, now to the temperature.First of all. If an instance method declaration is preceded with the virtual keyword, then this method is a virtual
It is to combine the members (attributes and methods) of an object into an independent unit and hide the internal details of the object as much as possible.
Copy codeThe code is as follows:
/*
* Encapsulation: one of the three main characteristics
Main three attributes of an object
Object behavior: You can apply those actions to objects, turn on the lights, turn off the lights is the behavior.
The shape of the object: When applying those methods is how the object responds, color, size, shape.
If a variable needs to be used in multiple methods, the variable is declared as a member attribute. you can directly use the member attribute in all methods of this object, which is equivalent to the global variable in this object.
The code is as
The concept of object-oriented is the core of object-oriented technology. In the display world, what we face is objects, such as computers, televisions, and bicycles. In object-oriented programming, an object is a whole composed of information and
Class member modifier question class & nbsp; a {& nbsp; private & nbsp; static & nbsp; $ p1; & nbsp; & nbsp; public & nbsp; static & nbsp; $ p2;} in the preceding code, add private & nbsp; what is the difference between a static modifier and a
If an instance method declaration is preceded with the virtual keyword, then this method is a virtual method.
The biggest difference between virtual and non-virtual methods is that the implementation of a virtual method can be replaced by a derived
Php learning notes: application of [encapsulation], one of the three main object-oriented features of php. Copy the code as follows :? Php ** encapsulation: one of the three main characteristics of object orientation ** 1. it combines object members
PHP object-oriented explanation. Three main properties of an object: actions that can be performed on the object. turning on the light is the action. Object form: the three main features of a color object are applied when the methods are used to
PHP learning (2): PHP magic method PHP treats all class methods starting with _ (two underscores) as magic methods. Therefore, when you define your own class methods, do not use _ as the prefix.
1. _ construct ()
When an object is instantiated,
Access Level of the constructor:
Public, protected, private, and default access level. Here, we will record the construction method modified by private.
Access Level of the private modifier constructor:
When the constructor is not declared as
As you know, the methods or attributes modified by the private modifier in Java can only be accessed within this class, and cannot be accessed by other classes. Is that true? The following example can be used to access the private method in a class.
instance constructs and reference typesThe previous chapters have actually written about the construction of reference types:First of all, of course, in the heap, allocate memory for the instance object of the reference type, and then initialize the
1 abstract class (1) Abstract methods are declared only, not implementations, and can be seen as virtual methods without implementing the body. (2) Abstract classes cannot be instantiated (3) Abstract classes can, but do not have to have
PHP treats all class methods that begin with __ (two underscores) as a magic method. So when you define your own class method, do not prefix __.
1, __construct ()
When an object is instantiated, the method of constructing the object is called
A purely personal point of view, if there is a similar, purely coincidental!Let's start by reviewing some of the common sense of inheritance in the OC we are familiar with.Subclasses can inherit from the parent class's: Public/protect decorated
Java Class design principles
Hides the data of the class with the private modifier, avoiding direct user access to the data.
Provides a common, default construction method.
The properties shared by all instances in the class should be
Preface: Recently read the "Java Multithreaded Programming core technology" a book, the sixth chapter of the Singleton mode and multithreading this chapter quite interested, I know I read the book or do not remember how much, write a blog record of
1. JVM-related (includes features for each version)For those who have just come into contact with Java, the knowledge of the JVM does not necessarily need to be understood very deeply, there is some simple understanding of the concept. But for a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.