Alibabacloud.com offers a wide variety of articles about thinking recursively with java, easily find your thinking recursively with java information here online.
I began to learn Java programming to contact OOP (object-oriented programming), just started to write programs in Java feel very awkward, because I used to use C to write programs, appreciate the simplicity and efficiency of C, like C concise and expressive ability of rich style, Especially can not endure Java run slow speed, relatively lengthy code, and a very s
Speaking of a freshman to learn C + +, but never contact VC + +, as for the interface is not until the beginning of learning Java, so he is a novice ah ...Step into the subject, through their own two small procedures, the interface to do the idea of finishing.First, imagine what the interface you want to implement is like. You can draw a profile on the paper (I did it ...). ), as far as possible, such as the click of a button to achieve a page jump, t
Thinking in Java notes, thinkingjava
I bought this book in my sophomore year. Now I have read this book again, and I have seen some details that I have not read before. This article uses version 4th to organize the notes of each chapter. A foreigner's book has a special feature. He will spend a lot of text to describe a concept, which is much better than heap code.Chapter 2 object Introduction
1.1 Abstracti
property->⑥ to construct a block of code.->⑦ initializes the object with the corresponding constructor initialization ⑧ the memory address to the P variable in the stack memory.7. Non-static omitted "this." Static omitted "class name."Static no access to heap memory (object non-static)The constructor points to the heap memory, and the method is stored in the method area.8. Design pattern: Partial thinking (the most effective way to solve a kind of pr
Original post address: http://www.cnblogs.com/feidao/archive/2005/07/15/193788.html
recently studied Java NiO as well as threading concurrency, made a point of thinking, special notes as follows (NiO article)
Because the previous project needs to write a number of high-performance servers, the results are written in a variety of results, we require the use of NIO to write asynchronous server, but unexpec
interfaces : Functions of classesLight LT = New Light ();Lt.on ();Hidden : How a class member/interface function exists (in the way it is used)PublicPrivateProtectedThe difference between reuse and inheritancemultiplexing : Automotive Containment Engine (A contains B)inheritance : Cats are animals (base class and export Class)Extends and coverage (overriding) conceptextends inheritance : Add function (original function automatically exists)overrding: Rewrite, different functions of the same inte
2.1 manipulating objects with references1. Objects and references can be used to manipulate objects by reference;2. The reference may also exist separately, that is, there is no connection with any object, and the reference operation without connection with the object will be error-free;2.2 All objects must be created by you1. Where to storeRegisterStacks:* fast storage destruction, basic types of storage placesHeap:* constant pool; where the generic object is storedConstant storageNon-RAM2. Exc
the class object is created, then the non-static members in the class are initialized, and the constructor of the class is called finally.Take a look at the following singleton patterns:public class bluetoothmanager {private bluetoothmanager () {} private Static class bluetoothmanagerholder {privatestatic bluetoothmanager instance = new Bluetoothmanager (); } public static bluetoothmanager getinstance () {return bluetoothmanagerholder.instance; }}Bluetoothmanagerholder initiali
destructors:reverse the order of CRE ation.3. Name hidingIf a Java base class has method name this is overloaded several times, redefineing the method name in the Derived-class W Ould not hide any of the Base-class versions (unlike C + +), Thus overloading works regardless of whether the method was Defi Ned at the-or in the base classClass Homer {Char doh (char c) {Print ("Doh (char)");return ' d ';}float Doh (float f) {Print ("Doh (float)");return 1
[Thinking in Java] Chapter 4th-control execution process, Chapter 4th4.1 if-else4.2 iteration 4.3 Foreach syntax 4.4 return4.5 break and continue4.6 switchDirectory
4.1 if-else
Else In if-else is optional and can be used in two forms:
if (Boolean-expression) statement
Or
if (Boolean-expression) statement1else statement2
Note that Boolean-expression cannot be a number. In fact, the conditional expressions
Starting from today, I want to break every example of thinking in Java into my computer. Only in this way can I improve the Java basics.
I remember someone said before that the most stupid method is usually a shortcut, and the key is persistence.
The same is true for technology.
Today, let's start with the interesting chapter "type information.
I have kno
java.util.concureent. * It is therefore only possible to use them in your own code in exceptional circumstances, even if used, to ensure that there are no other problems that may arise.* Usually depending on the lock to be more secure (either Synchronizedkeyword, or an explicit lock object) * @author Lenovo * */public class Atomicevengenerator extends Intgenerator{private atomicinteger currentevenvalue=new atomicinteger (0); @Overridepublic int Next () {return Currentevenvalue.addandget (2);} p
are set to default values, the object's reference is set to NULL, and if there is an initialization block, the initialization block is executed, and the constructor is initialized at the end. Variables are initialized in their order. The following code demonstrates the process of initialization:Package LKL; Public classBase { Public intI=9;/// Specify a default value first Public intJ Public intK Public intD Public Base(intx) {j=i; I=x; K=i; } {i=Ten;// initialization bloc
Thinking in java– type information
Personally feel the more difficult part of Java, in the look at some Netty source code found in fact this piece is very practical.
This chapter focuses on Rtti and reflection. Say your own understanding first.Rtti is an execution-time recognition. is implemented in C + + with virtual, which ignores the ob
1. High precisionBigInteger, BigDecimal support for arbitrary-sized numbers can not be used operator operation speed relative to int, float slightly slower2. Object Scope{ new String ("AAA");}Outside of this stack, the reference S has gone beyond its scope to exist, but the new String ("AAA") objects in this heap still exist in memoryAt this point, Java garbage collection detects those unreferenced objects and then automatically frees the unused me
Alan Kay summarizes the five basic features of Smalltalk (one of the languages on which Java is based):① All things are objectsConsider an object as a fancy variable that can store data and perform operations on itself.② programs are collections of objects that tell each other what they want to do by sending messages.You can resemble a message as a call request to a method on a particular object.③ each object has its own storage that is composed of ot
Tag: member function represents abstract own age unit operation parameter inputThe core idea of Java, object-oriented thinking.The highest level of Java-oriented objects is the object of everything.Objects: In reality, things can be called objects, objects are physical things, people, birds, tables, trees, buildings and so on. Object also has its own property behavior, and attribute behavior is divided into
class sequenceselector implements Selector{ Private intI=0;/// number of current access to element Public Boolean End(){returnI==items.length; } PublicObject Current(){returnItems[i]; } Public void Next(){if(i/// provide external interface for iterators PublicSelectorselector(){return NewSequenceselector (); } Public Static void Main(string[] args) {Sequence sq=NewSequence (Ten); for(intI=0;iTen; i++) Sq.add (integer.tostring (i));/// use an iterator from the sequence itself
inner class automatically has access to all members of its perimeter class, and the inner class object has this reference to the Outer class object10.3 using the. This and. NewCreating an inner class object using an external class object10.4 Internal classes and upward transformation10.5 Inner classes within methods and scopes10.6 Anonymous Inner class10.7 Nested ClassesInner class declared as static10.8 Why internal classes are requiredThe inner class provides some kind of window into the peri
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.