Tags » Java 2

The Usefulness of the Java Random Class

The Problem with the Math.random() Method.

When you want to generate a random integer, the java.util.Random class is a much better utility than the Java.lang.Math.random() method. 649 more words

Java

Performing Multiple Statements in the Update Section of a Java For Loop

The Java For Loop.

The format for a Java “for” loop is specified as follows :

for(initialization; Boolean_expression; update)
{
   //Statements
}

(see Java Loops – for, while and do…while… 512 more words

Java

Eclipse ResourceBundle Plugin - Update

Today I tried to install the Eclipse ResourceBundle Plugin (which I posted about here) in Spring Toolsuite 3.6 which is based on Eclipse 4.4 (Luna) and was horrified the version 0.8.0 does not work. 113 more words

Java

String Vs String Buffer in Java

String: String is immutable means we can’t modify a string object once it is created. We can replace it by another instance of String.

StringBuffer:  173 more words

Java

Change Final variable value in Java

Have you ever thought of changing final variable in Java !!.

We all know that once the final variable is assigned value we can’t change it. 208 more words

Java

Maven snippet - add generated sources to the build

Here’s a maven snippet I found myself looking for many times – adding generated sources to the build.
This tells Maven to include the generated classes as part of the compilation, which ensures any non generated code that depends on them compiles fine, and their corresponding .class files be included in the .jar/.war file. 124 more words

Java

Hibernate hidden gem: the pooled-lo optimizer

Introduction

In this post we’ll uncover a sequence identifier generator combining identifier assignment efficiency and interoperability with other external systems (concurrently accessing the underlying database system). 963 more words

Java