Category Language

Java Memory Structure

Static memory (Method area) Method information and Field information. Global constants and other data generated by the compiler(e.g. info to ...

Java features

Java is Easy to write and more readable and eye catching. Java has a concise, cohesive set of features that makes it easy to learn and use. Most ...

[String] concat() vs. +

concat() and + both add up strings. It looks same, but + do one more step. As seen below, + will create string builder and append the strings ...

Error & Exception

Error is thrown by JVM in a scenario which is fatal and there is no way for the application program to recover from that error. Unchecked type: ...

Wait() vs. Sleep()

Wait and sleep method are completely different to each other wait() & notify(): method for inter thread communication. sleep(): introducing ...

Synchronized in Thread

While running multi-threads, there will be a significant problem when those threads try to use same resource. For example, multiple people try to ...

System.nanoTime()

It will give you current time in nanoseconds(precise). Usually used for measuring performance of the code. To convert it to in seconds, divide it ...

Runnable vs. Thread

For both, you need to Override run() method to be created as a new thread by start() call. implements Runnable (preferred way) it shares the same ...