2013年5月18日

[機車保養] Jet Power磨離合器蹄片

關鍵字: 離合器蹄片、Jet Power


買車四年來里程數已來到28000KM了,利用下午時間更換了機油,就順便把傳動拆下來清理,順便把離合器蹄片磨一磨,下週末學弟揪跑阿婆灣,話不多說來比較一下磨合前後



2013年5月6日

[Java] 關於Java的passed by reference 與 passed by value

參考文章: http://javadude.com/articles/passbyvalue.htm


Pass-by-value
The actual parameter (or argument expression) is fully evaluated and the resulting value is copied into a location being used to hold the formal parameter's value during method/function execution. That location is typically a chunk of memory on the runtime stack for the application (which is how Java handles it), but other languages could choose parameter storage differently.
Pass-by-reference
The formal parameter merely acts as an alias for the actual parameter. Anytime the method/function uses the formal parameter (for reading or writing), it is actually using the actual parameter.



In Java, Objects are passed by reference, and primitives are passed by value.
This is half incorrect. Everyone can easily agree that primitives are passed by value; there's no such thing in Java as a pointer/reference to a primitive.
However, Objects are not passed by reference. A correct statement would be Object references are passed by value.