Deep dive into Java Generics(0x01)

Recently our team has made a new library to wrap our Routing and Navigation API for Android platform, and we have heavily used Generics to export our functions which saves us a lot templates code and make the code more expressive. However, the Java Generics itself is not that straight comparing with other language’s implementation, especially the confusion due to the type erasure of java runtime. So the topics following are the summary of what I have shared internally.

Read More

Volatile in Java

Recently, there is a very interested topic bringing up in my desk: What is Volatile in Java? Some guys in my team are saying that Volatile is used for keeping one copy in memory to avoid duplicate object in stack since Modern CPU has multiple cores and each of them has its own cache of the copy, and some others are arguing that Volatile is same as synchronized.

Read More

Find the maximum subarray XOR in a given array

There is a very insteresting problem when I have a talking with my friend. When we sit together and bring up the brainstorm, it guides us well to understand the inside nature of the problem. That’s where this post was created from!

Read More

Memory leak in Android

GC(Garbage collection) is one of most important features in Java, which greatly increases developer’s productivity and save a lot away from the most painful things when we are writting programs.

Read More

Clean Architecture

There is a beautiful document talking about how to build a clean architecture which I leave one copy here. If you are more interested in it, see the original post by Uncle Bob

Read More