Category: Java

RegEx to match Java Comments

RegEx to match Java Comments

Most(if not all) of the regular expressions a developer needs is already available. There are numerous resources online ranging from blogs and even an ever growing library. Not to mention the endless discussions on stackoverflow.

Few days back, I had lost the sources to a project and had to decompile them from the original build. Did not expect the decompiler to throw in so much comments.

String intern() function and String Pool

String intern() function and String Pool

The Java programming language requires that identical string literals (that is, literals that contain the same sequence of code points) must refer to the same instance of class String. In addition, if the method String.intern is called on any string, the result is a reference to the same class instance that would be returned if that string appeared as a literal.

A Requiem for Marker Interfaces

A Requiem for Marker Interfaces

Having written about Java serialization previously, I thought I’d put in some research into the concept of ‘Marker Interfaces’ or ‘Tag Interfaces’. Well, getting matters straight, technically, the word ‘Marker’ is an invention of bloggers and technical writers. Java specification says nothing about an interface being a ‘Marker Interface’. You won’t find the word ‘Marker’ at all..