Discussion & Examples: Java enums versus public static finalSeptember 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?
Using public static final as enum has many problems, such as:
Not typesafe - Since a type is just an int you can pass in any other int value where a particular type is required, or add two types together (which makes no sense). This is particularly noticeable in C programs where you will find strange constants being used in un-related place and yet it seems to work, simply because the required constant and the provided constant share the same int value.
Java or C#January 10th, 2004 On the old debate - C# versus Java
J2SE 5: New wine in new bottle with old corkMarch 15th, 2005 J2SE stands for Java 2 Standard Edition. The 2 stands for version 2 of the platform.
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.
Java SE Goes Beta (Feature Complete). Download Now.February 17th, 2006 Java SE 6 Beta offers the first feature complete version of next major release of the Java SE platform. Sun expects to ship the final release of Java SE 6 in the fall of 2006.
Three Free Notable Java Software / APISeptember 8th, 2005 GMail API for Java
GMailer API for Java (g4j) is set of API that allows Java programmer to communicate to GMail. With G4J programmers can made Java based application that based on huge storage of GMail.
Java Popularity Statistics (from JavaOne 2008)May 7th, 2008 Sun revealed the following statistics about Java at JavaOne 2008:
1. 90% of Personal Computers on Internet have Java
2.
Gripe: Java blog aggregator: javablogs.comFebruary 16th, 2004 Few Gripes on Java.blogs:
After few days with java.blogs I realized I don't want a few things. For example I am not interested in knowing anything about IDEA releases.
Java EE 6 HighlightsMay 6th, 2008 The key features of Java EE 6 (Java Enterprise Edition version 6) are:
Modular Platform - Java EE 6 introduces profiles targeted for particular segment of users like web developers or mobile developers. Java Profiles allows you to select Java EE 6 features to be included in a profile.
Java Blogger's in IndiaDecember 11th, 2005 I want to create a list of Java blogger's in India or of Indian origin. If you are one please state so with your url in the comment below.
Top 10 Java LiesMarch 6th, 2006 Here are the top ten Java lies I have heard over the years. Feel free to add yours in the comments.
How To Pass Command Line Arguments To Ant Task / ScriptAugust 17th, 2008 Ant is a popular, high quality Java based build and deployment tool from Apache Foundation. You can invoke Java programs in ant using the java task.
Java Framework To Create Java FrameworksJanuary 26th, 2006 I have seen way too many java frameworks, way beyond my limits of tolerance. And I have found a perfect solution.
How To Solve Apache Ant java Task Execution ErrorsJuly 26th, 2006 I have seen myriad errors when executing java task. For example I have seen: javax.xml.parsers.FactoryConfigurationError?: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl? not found when executing the java task in jdk1.5.0
The problems with debugging the errors is that the commandline used by java task is not visible, even in verbose mode.
How to install / enable Java Plugin / Applets in Firefox on CentOS 5September 28th, 2009 CentOS comes with OpenJava JRE installed. However that doesn't provide the required libraries to run Java from browsers (read: applets).
November 24th, 2008 at 7:38 am
Should the switch really be “UserAgent.FIREFOX”?
It would make more sence with something like “UserAgent.Type”, or maybe I am missing something.
Kind Regards
Martin
November 24th, 2008 at 12:20 pm
These are not regular variables but enums to represent user agent for different browsers.
Hope that clarifies…
July 15th, 2009 at 4:41 pm
Thanks for post
July 17th, 2009 at 9:12 am
thanks !
October 29th, 2009 at 8:52 am
This example is obviously wrong. The switch should be an enum variable. For example:
UserAgent variable = UserAgent.FIREFOX;
switch (variable) {
case IE: null; //whatever_must_be_done;
}