1. Minimizing the accessibility of classes and membersA. Encapsulation (data privatization, method openness)/externally available callable, stable functionsB. Accessibility should be clear
Modifier
This class
Same
ObjectiveReviewing the Java modifiers and the string class in the previous article, this article looks back at the three main features of Java: Encapsulation, inheritance, polymorphism.Encapsulate what is encapsulated
In the object-oriented
1, use iterators: Notice whether iterator is invalid2, write a case-insensitive string type, other aspects of the same as StringScenario: Modify Char_traits3. Temporary objectsUse const& instead of transfer value copies;Use PRE + + to avoid post + +
java object-oriented: here to organize the basic object-oriented knowledge, to help you learn to understand, I hope to help you, here is according to the company interview data collation related knowledge:
The difference between overload and
Objective
In actual development, have you ever encountered such a problem; develop a class that encapsulates the core operations of an object that are invoked by the customer when the class is used, while some non-core operations may or may not be
Notes polymorphism
Polymorphism (polymorphism) is also referred to as dynamic binding "dynamics binding", late binding after binding, or runtime binding "Run-time bingding".
It means to decide which method to bind, depending on the type of object,
26 c # class combination,
A combination combines all parts. In program design, existing class objects are used to generate new classes.
The table is made up of wooden boards and nails. The desk lamp is made up of lamps, tubes, wires, and connectors.
JVA basics: 30 suggestions for writing JAVA code-general Linux technology-Linux programming and kernel information. For details, see below. (1) The first letter of the class name should be capitalized. The first letter of the field, method, and
Design Guidelines (2)
Many service requests over the Internet may affect the performance of your applications. When designing your XML Web Service, you can effectively use service requests by creating a method that aggregates relevant information.
Recently in the C + +, and then read more about the object-oriented knowledge points, good memory is not as bad as the written, summed up the classification.In object-oriented, inheritance is a very important basic concept. When you derive a new
I haven't seen such an incisive article for a long time! The author wrote it too well! If you are learning Java or want to know about abstract classes and interfaces, do not miss it! I strongly recommend it!
Differences between interfaces and
Some principles for rewriting methods in inheritance:
Do not change the meaning of the Conventions when override the parent class method after implementation. Anyone can assume that the subclass and the superclass work in the same way.
Potential
I l @ ve ruboard
Item 28. Minimizing compile-time dependencies extends Art 3Difficulty: 7Now the unnecessary headers have been removed, and needless dependencies on the internals of the class have been eliminated. Is there any
Prepare an abstract class, implement part of the logic in the form of a specific method and a specific constructor, and then declare some abstract methods to force the subclass to implement the remaining logic. Different sub-classes can implement
the bad taste introduced in is to sniff the Code directly. however, since TDD is adopted, all bad taste of the code will be reflected in testing. For example, if a function has too many test cases, it may mean that the function has too many
By providing constructors, the class designer can ensure that each object is initialized.
This policy is appropriate because the garbage collection mechanism also has overhead.
Finalize () is required because free () is used in the C language
In the sixth chapter of the Book of code, I have mentioned some principles relating to inclusion and inheritance, which I have extracted as follows:One, including ("has a")Contains a class that contains a basic data element or object. Inclusion is
The synthetic multiplexing principle, also known as the combinatorial/aggregation multiplexing principle (composition/aggregate reuse Principle, CARP), is defined as follows:
Synthetic multiplexing principles (Composite reuse
From: http://wxdlut.blog.163.com/blog/static/128770158200992373211377/
Programmers must know: C/C ++ interview questions (7)
1. Introduce STL and explain in detail how STL implements vector.
Answer:
STL (Standard Template Library. It consists of
Source: http://blog.csdn.net/nilxin/article/details/1613574
Special methods in the class
Generally, special methods are used to imitate a behavior. For example, if you want to use index operations such as X [Key] for your class (just like the list
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.