Public: open to any class and member, unrestricted access;Protected: Only the class and derived classes of that class are exposed;Private: Only open to the class;Internal: The class can only be accessed in assemblies that contain the class (only
Java provides three access control permissions: Public protected private. Therefore, the access permission with the name "anonymous" means that external users cannot access the database. When inheriting the database, you must consider whether the
Difference between public, protected, and private: protectedprivate
Use className: functionNmae (), instantiation, parent, and self to draw a conclusion.
ClassName: functionNmae () must be a static method (public Mode)
Parent: functionNmae () the
/* Function, C ++ public, protected, private date, March 13, 2013 environment, ubuntu1204-gcc blog, login Using STD: cout; Using STD: Endl; template void OK (t) {} Class A {// public can be accessed anywhere in the program, you do not need to use
First: The scope of Private,public,protected's interview: private: Can only be visited by the function in the class, its friend function, can not be any other interview. Objects of this class cannot be interviewed.Protected: Can be interviewed by
From:http://blog.163.com/weiwenjuan_bj/blog/static/14035033620129304183850/?suggestedreadingPublic: Common TypeThe public method or property can be called through Self::var in a subclass, Parent::method calling the parent class methodA method or
for the public inheritance method:(1) The public member of the parent class becomes the public member of the subclass, allowing code outside the class to access those members ;(2) The private member of the parent class is still the private member of
Public: The public type can call the public method or attribute through self: var in the subclass. parent :: the method calls the parent class method. You can use $ obj-var in the instance to call the public type method or attribute protected: the
Access Modification
Class
Derived classes of the same assembly
Other classes of the same assembly
Derived classes of different assemblies
Other classes of different assemblies
Priavte
True
FROM: blog.163.comweiwenjuan _ bjblogstatic14035033620129304183850? Suggestedreadingpublic: The public type in the subclass can call the public method or attribute through self: var, parent :: the method calls the parent class method. You can use $
Maybe some new users do not pay much attention to the use of access modifiers in the initial stage of programming, but after the "creation" error, I think most people will take it as an example and pay more attention to it!
The incorrect access
Access permission:
Public public interface: open to the outside world and can be accessed through an object or Class Name
Protected Access: the access permission is only available to sub-classes and cannot be accessed through objects.
First, the access range of the private, public, and protected access labels.
Private: It can only be accessed by 1. functions in this class, 2. Other functions.Cannot be accessed by any other user, nor can the object of this class be accessed.
First, you need to understand the points:1, one of the characteristics of a class is encapsulation, and public and private functions are to achieve this purpose.User code (outside the class) can access public members without access to private
Reprint Address: https://blog.csdn.net/qq_35429198/article/details/51982862
Public slots: A slot declared in this area means that any object can connect the signal to it. This is useful for component programming, where you can create objects
When private, public, and protected are set as members of a class:PRIVATE: It can only be accessed by functions in the class and their meta-functions. It cannot be accessed by any other function, nor can it be accessed by objects in the
In Java, the three reserved words are used to modify the data members and member functions of the class, and the class itself. In C ++, the data members and member functions of the modifier class, and the inheritance of the class, but you don't need
Reprint Address: https://blog.csdn.net/qq_35429198/article/details/51982862
Public slots: The slot declared in this zone means that any object can connect the signal to it. This is useful for component programming, where you can create objects
Before, have seen a lot of nhibernate things. In particular, Yjinglee's NHibernate Tour series is more classic. See more, but have not really done from the beginning to the end of the side. I've done it all over again today and found a lot of
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.