Vote 6

Java: How To Use Enum in Switch

September 23rd, 2008

When using enums in a switch, it is almost natural to assume they will be used like a regular switch. Unfortunately to accomodate enums, Java had to enhance its specification and enums in switch behave differently than regular switch statements in two significant and non-trivial ways.

Read more (197 words) »

Vote 5

Discussion & Examples: Java enums versus public static final

September 23rd, 2008

Should we use to represent a constant String such as browser's user agent or simply use public static final String as before?
Read more (446 words) »

Vote 5

Java: How To Get Stacktrace of Any Local / Remote Java Process

September 23rd, 2008

You may run Java processes in the foreground or in many cases they may be run using cron jobs or during system startup, as background processes. How can you find out stacktraces of any running Java process? But first how can you even know their name & process id's?
Read more (312 words) »

Vote 5

Vodafone Adopts Java MoM for High Speed Mission Critical Messaging

September 9th, 2008

Vodafone Group Plc (www.vodafone.it) is arguably the world's leading mobile telecommunications company, with a significant presence in Europe, the Middle East, India, Africa, Asia Pacific and the United States through the Company's subsidiary undertakings, joint ventures, associated undertakings and investments. Vodafone has chosen FioranoMQ, Java Messaging server, for a mission-critical system delivering over 2500 messages / sec.

Read more (104 words) »

Vote 7

Core Java: How To Get Java Source Code Line Number & File Name in Code

September 8th, 2008

While debugging code Java programmers often use System.out.println(). It is important to write separate message in each System.out.println() so you can understand from the output where the problem lies.

Read more (167 words) »

Vote 1

Java: Why Braces in Finally?

August 29th, 2008

Why does finally have to have braces?

Read more (78 words) »

Vote 1

Why is Java import static brain dead?

August 29th, 2008

Let's begin with an example. Assume a class MQ is in the packageĀ  com.taragana.mq. The utlitiy class Util also belongs to the same package. I can import Util from MQ like this:

Read more (100 words) »

Vote 2

The Power of Ant (Build System)

August 27th, 2008

I am using Ant (Java based build system) for our project. Ant is an exceptionally powerful build system and should be the only build system you will ever need. You don't really need code monsters like Maven (or pile of …. as Bileblogger loves to say). With little effort here's what I achieved in few hours (aside from the obvious capability of compiling, running, building jar files etc.):
Read more (497 words) »

Vote 3

Java Quiz: Why StringBuilder Should be Used Instead of StringBuffer?

August 23rd, 2008

First tell me what is the best way to concatenate large number of String objects? Is it a + b?

Most Java developers know not to use a + b (+ operator) because of huge performance problems, they use StringBuffer instead. In fact I did some tests in the past which confirms this folklore. However some of you may not know there is new kid on the block - StringBuilder. Read more (116 words) »

Vote 4

How To Delete Property From java.util.Properties

August 23rd, 2008

This isn't a trick question. For a long time you couldn't delete a property from java.util.Properties class. In the recent versions too Java doesn't reveal that it has added the functionality. However as java.util.Properties now extends Hashtable, you can delete a property by:

Read more (67 words) »