Posts Tagged ‘Java’

   Newer Posts »

Tips for Using Log4j

Log4j is a logging framework for Java, part of Apache’s suite of logging frameworks for various languages. While using log4j on various applications, I have had to figure out how to do certain things that were not clearly documented, possibly because the full manual for log4j is only available commercially. Before showing what I have [...]

Advanced Uses of Java 5 Enums

Enumerated types – called enums for short – were introduced to the Java language recently in version 5 (the version after 1.4). The name essentially defines what they are: a type that has a fixed set of constant values. The Java Sun website has a good tutorial on using enums which covers their basic capabilities. [...]

Parsing and Generating XML with Java

December, 2008 Update: I now recommend using JAXB and annotated Java objects to parse and generate XML. See my article Simple XML Parsing using JAXB for details. I’ve worked a lot with XML over the years (i.e. for Ant build files), but I’ve never had to parse or generate XML in Java until recently. There [...]

Understanding Java RMI: A Simple Tutorial

I recently needed to write a simple java client-server application, and decided to implement the communication mechanism using Java RMI (Remote Method Invocation). I’ve used RMI in the past indirectly (i.e. when coding EJB session beans), but never directly, so I turned to Google to see what RMI tutorials were available. I quickly found several [...]

Local Variable Declarations

When coding in Java, I prefer to declare local variables at their point of use. On a recent project, I have encountered developers who have been taught in their computing science course(s) to put local variable declarations at the start of the method (when using Java). Back in the days of C this was a [...]

   Newer Posts »