| View: | [ 2009 | 2008 | 2007 | 2006 | 2005 | 2004 | 2003 ] |
| Articles Tips |
- Taming Tiger: Beyond the basics of enumerated types by John Zukowski - [Clicks: 73]
In November 2004, Brett McLaughlin got you started using enumerated types with the Java 5.0 platform. In this month's Taming Tiger, columnist John Zukowski explains how to work with enumerated classes and their predefined methods and shows how to add constructors, override methods, and have instance variables.
http://www-128.ibm.com/developerworks/library/j-tiger04195/ - Apr, 2005 - Boxing Conversion in J2SE 5.0 by Krishna Srinivasan - [Clicks: 31]
Last year, Sun released its latest version of Java, J2SE 5.0, with lots of new features. One of them is the autoboxing conversions for primitives and wrapper objects. This article gives some insight about what boxing conversion in Java is, and how it is used in real-world programming. I will present the meaning of autoboxing and a few programming techniques.
http://today.java.net/pub/a/today/2005/03/24/autoboxing.html - Mar, 2005
- Introduction to Autoboxing by Daniel H. Steinberg - [Clicks: 13]
Although the Java programming language is an object-oriented language, it's often the case that when using the language you need to work with primitive types. Before J2SE 5.0, working with primitive types required the repetitive work of converting between the primitive types and the wrapper classes. In this tip, you will see how the new autoboxing feature in J2SE 5.0 handles conversions -- for example, between values of type int and values of type Integer. The tip also discusses some autoboxing-related considerations in determining when two numerical values are equal.
http://java.sun.com/developer/JDCTechTips/2005/tt0405.html#1 - Apr, 2005 - Changing Behavior Based on the Value of an Enumerated Type by Daniel H. Steinberg - [Clicks: 35]
When you first use enumerated types, you might simply see them as an alternative to using constants. However they have other interesting uses. For example, you can change the behavior of a class based on the value of an enumerated type. This tip will show you how to implement enumeration constant-specific behavior in an elegant way.
http://java.sun.com/developer/JDCTechTips/2005/tt0208.html#2 - Feb, 2005 - Using the Varargs Language Feature by Daniel H. Steinberg - [Clicks: 10]
Have you ever found yourself in the following situation? You need to pass in many instances of the same object type to a method, but you don't know at compile time how many instances there will be. In the past, the only way to handle this situation was to bundle these objects in an array or other collection. However with J2SE 5.0, you now have the added convenience of using variable arity parameters, known less formally as varargs. In this tip, you will learn why it's a good idea to take advantage of varargs as a client of an API. The tip also cautions against introducing varargs to an API that you create, unless it is warranted.
http://java.sun.com/developer/JDCTechTips/2005/tt0104.html#1 - Jan, 2005