JavaBeat Certifications Certifications Kits Articles Interview Questions OCAJP 7 OCPJP 5 OCPJP 6 OCEJWCD 6 SCBCD 5.0 SCEA SCJA
Submit Links | Latest Links | Login (want to submit links for DLinks? send a mail to krishnas@javabeat.net)

Importance of specifying initial capacity while instantiating ArrayList and HashMap

java Comments
  • 0 votes
ArrayList and HashMap are a few of the most frequently used data structures in Java development. So I would like to talk about the importance of instantiating these classes with initial capacity. Let me explain how the ArrayList works internally, so that you get a good insight. HashMap works almost the same way an ArrayList works, so I haven’t covered the details of that separately. But all the tips given below are applicable for HashMap as well.... more »

Volatile and doubled checked locking in Java

java Comments
  • 0 votes
During my Java training, I read about volatile keyword, but didn’t get clear understanding. Recently when I wrote a singleton class using double checked locking, PMD code reviewer gave a warning not to use volatile. Later I started exploring on double checked locking issue, here is my observation.... more »

Java: How to stop a thread?

java Comments
  • 0 votes
This is one of the frequently asked questions in the interview. Most of the interviewer expect the below answer. “Thread.stop() method is deprecated, so a boolean variable has to be introduced in thread class and run method should check the boolean variable whether to continue execution or come out of run() method”.... more »

What is the better approach to implement Singleton pattern?

java Comments
  • 0 votes
Singleton is one of the frequently used and easily understandable design pattern. Most of the tutorials and books give example of making the constructor as private and exposing a static method which will provide single instance. The common example they use is Runtime class of JRE.... more »

Howto generate Hibernate POJO and mapping files using ant from a db schema

hibernate java java5 Comments
  • 0 votes
This is the ant task I’m using to generate POJO and mapping files from a DB Schema (mysql).... more »

How to Create Jar Files from Ant

java Comments
  • 0 votes
Lets take this time in consideration a real life project. Most of the time Ant is used to compile and build java projects. This means generating, compiling and building jar files. For this we are going to define severals tasks. Lets consider the we create a buid.xml file in the directory where sources are located. The sources are put in the subdirectory called src. We also need to include a jar in the classpath while compiling. We are going to create a separate property file to define the location of this file:... more »

Creating Google Guice Modules with Java 6’s ServiceLoader

java java6 google-guice Comments
  • 0 votes
Google Guice is a lightweight dependency injection framework for Java 5 (or later), which is explained here very well.... more »

My Java 7.0 Wishlist

java java7 Comments
  • 0 votes
Well, the JDK7 Project is underway, and despite the fact that I am being moved into the .NET world for some new projects, I wanted to leave some parting thoughts with the Java community. By no means do I consider myself the ultimate authority on the following topics, however, these are a few things that I propose would make Java a better, more friendly, more flexible language.... more »

Java is losing the battle for the modern Web. Can the JVM save the vendors?

java Comments
  • 0 votes
A few years ago I worked on a very big Enterprise IBM Websphere project. We had some brilliant engineers in the project both in the development and architecture groups. I remember having had several discussions with some of the brightest people on the team regarding PHP and dynamic languages and generally they were looked upon as toy languages without a bright future. Lack of strict typing, scripting performance, and other reasons were given for why Java would persevere as the language of choice.... more »

Java Collections and Iterators

java java5 Comments
  • 0 votes
Do you shy away from using the Java collection framework? Do you find the unwieldy notation puts you off using the classes in this framework? If so, you may be writing unnecessary Java code. Stephen Morris shows you how easy and efficient the collection framework is to use.... more »
 

javabeat | advertise | about us | contact | useful resources
Copyright (2004 - 2013), JavaBeat