This article mainly lists some of the common Java to make sure that people do not pay attention to the problem.
will continue to be updated, welcome attention ...
If you feel unreasonable, welcome to comment exchange, no sparks how impressed?
(1) is Java really a value pass? Or a reference pass?
Find out the problem is because some students said to start blogging, so he wrote how to blog: Java is the value of the pass? Or a reference pass? , say let me see.
I feel quite reasonable after reading, immediately to his reply said "good oh". Reasonable is reasonable, but according to his argument, what is not the value of the past Ah, is the value of delivery?
This morning to work, came earlier, Baidu a bit this problem, and then saw another article: Java: By value or by reference to pass the detailed explanation, inside the comment is a variety of tear force. Still don't get a unified answer AH.
See another article in the back: Java only by the value of the pass, not by reference! , as well as the comments corresponding to the article. I have my own opinion, too.
In general, "there are only basic types in Java, and strings that are defined in this way are passed by value (that is, the string is defined directly using double quotation marks: string str =" small Pigeon "), others are passed by reference. "It ought to be right."
Once a java.lang.String instance object is created, the sequence of characters it contains cannot be changed.
String is also passed as a reference copy, but because string is final, it is equivalent to passing by value.
In fact, by value or by reference is the difference between "whether the memory copy of the object at the time of delivery", the basic type in Java is because the storage area in the JVM is different from the ordinary object so that the transfer will be copied, pass the copied value, but the object is not copied at the time of delivery, direct "reference value", Points to the same piece of object heap memory area.
Constantly updated in .....
About Java, those things I have doubts about (constantly updated ... )