Featured

Featured
Java

Blank final field in Java

A variable that is declared as final and not initialized is called a blank final variable. A blank final variable forces the constructors to initialize it. In other words The final property of class must have a value assigned before object is created. So the last point where you can assign value to them is […]

Read More
Featured
Java

Fail Fast vs Fail Safe Iterator in Java

When an iterator is created, either it is directly created on the collection (Fail Fast), or created on a clone of that collection (Fail Safe).This brings below two types of Iterator. Fail Fast : As name suggest fail-fast Iterators fail as soon as they realized that structure of Collection has been modified since iteration has […]

Read More
Featured
Java

Double Brace Initialization In Java

Another way of initializing collections and objects in Java. This is rarely known concept of Java,although this type of initialization has been with java from many years. The technique/concept is called Double Brace Initialization technique in Java. Lets start with an example. Using ArrayList in java (Normal way) List languages = new ArrayList(); languages.add(“English”); languages.add(“Hindi”); languages.add(“German”); Double […]

Read More
Featured
Java

JVM Shutdown Hook

As the name specifies its a Hook provided by JVM to register a Thread when it shut down. i.e. piece of instructions that JVM should execute before going down. How To Achieve The java.lang.Runtime.addShutdownHook(Thread hook) method registers a new virtual-machine shutdown hook. When to Use To release critical resources in the event of unexpected JVM […]

Read More
Featured
Java

Use of Robot Class

Programming in Java doesn’t have to be dull and boring. In fact, it’s possible to have lots of fun while programming in Java. Lets use the Robot class to write programs that are both fun and useful. Added in JDK v 1.3 . As Per Sun (now Oracle): “This class is used to generate native […]

Read More
Featured
Java

System.out.println : So called SOP/sysout

Widely used statement in Java and interestingly its one of the most number of times compiled statement in the history of java, also commonly asked interview question. Here we will try to understand some interesting fact about sysout. Inside System Class  (Check with JDK Source Code) Java Doc public final static PrintStream out = nullPrintStream(); As you […]

Read More
Featured
Tech Tweets

What happens on the Internet every 60 seconds

Let’s say that it takes you exactly one minute to read through this post. In that time, over 6,600 photos will be uploaded to Flickr, about 70 new domains will be registered, over 1,200 new ads will be created on Craigslist, and more. Here’s what happens on the Internet every 60 seconds. That disclaimer aside […]

Read More