1.private modifier
The private modifier is used to set the access rights of a class or class member to the internal of the owning class only.Private is also known as a proprietary modifier. When you need to access a private class member at some
PrivateDecorated member variables and functions can only be accessed in the class itself and in the inner class.
ProjectedDecorated member variables and functions can be accessed by classes themselves, subclasses, and classes in the same package.
When developing internal projects or individual modules (Non-public modules), the use of the modifiers on access rights may not be very noticeable, but access modifiers are important in the writing of public code or the development of an SDK class.
One, the difference of public,private,protectedPublic: Permissions are the largest, can be called internally, instance calls, and so on.
Protected: Protected type, used for this class and inheritance class invocation.
Private: Proprietary type, only
There are three types of access modifiers in PHP, respectively:Public (common, default)Protected (Protected)Private (privately)Public (common, default) in PHP5 if the class does not have an access modifier for the specified member, the default is
------java training, Android training, iOS training,. NET training , look forward to communicating with you! -------The composition of the/** method:* [permission modifier list] [other modifier list] return value data type method name (parameter
I. Access control for a single class1. Class member access level (public, private, protected)Public: Decorated data members, member functions are inside the class and can be used outside of the class.Protected: Decorated data members, member
1. What is a Java Virtual Machine?A Java virtual machine is an imaginary machine that is simulated by software on an actual computer. The Java Virtual Machine has its own hardware, such as the processor, stack, and register. It also has the
One, the life cycle of a Java Virtual machine:The life cycle of a Java virtual machine A running Java Virtual machine has a clear task: Executing a java program. He runs when the program starts, and he stops at the end of the program. You run three
I. Purpose of introducing inheritance
1. code reuse
The Inheritance and derivation mechanisms of classes enable programmers to get new classes by adding a small amount of code or modifying a small amount of code on the basis of existing classes
One, the life cycle of a Java Virtual machine:The life cycle of a Java virtual machine A running Java Virtual machine has a clear task: Executing a java program. He runs when the program starts, and he stops at the end of the program. You run three
One, C + + occupies memory allocation1), stack (stack)-Automatically allocated by the compiler to release, store the function's parameter value, local variable value and so on. ItsOperations are similar to stacks in data structures.2), heap area
The JVM principle of "reprint" JavaTransferred from: http://blog.csdn.net/witsmakemen/article/details/28600127/One, the life cycle of a Java Virtual machine:The life cycle of a Java virtual machine A running Java Virtual machine has a clear task:
One, the life cycle of a Java Virtual machine:The life cycle of a Java virtual machine A running Java Virtual machine has a clear task: Executing a java program. He runs when the program starts, and he stops at the end of the program. You run three
Java Virtual machineJava Virtual machine is a Java file generated by the class file, the class file is the bytecode, the JVM can explain the bytecode becomes the machine code of the target machine, so the Java program can be compiled once and then
Java variables: class variables (static adornments), member variables, local variables, Java no global variables
Create object: A. Declaring variables, B. instantiating objects, c. Initializing variables
Java access modifier: public: All
Java virtual machine architecture, Java Virtual MachineLifecycle of a Java Virtual Machine
A running java VM instance is responsible for running a java program. When a Java program is started, a virtual machine instance is born. When the program is
In the C # language, there are five types of access modifiers: public, private, protected, internal, protected internal. The scope of action is as follows:
Access modifier description
Public access. Not subject to any restrictions.
Private access.
Java (2), java (2)
Briefly describe the operating mechanism of the constructor
The first thing to note is that the constructor is not a function, so it cannot be inherited. This is common when we write sub-class constructor in extends, even if
1. Java Permissions Control--Most people are brainwashed by mistake.A major pit, or a major misunderstanding, or a brainwashing of thousands of Java programmers, the wrong concept is:The public private protected is based on methods and objects.For
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.