Language HowTo
*Read me*
General
Obtain from where a Class is loaded
Get the class name in a static method
Get the current method name
Call a method dynamically
Detect if a package is available
Create an Object from a String
Get a variable value from the variable name
Make methods that have unspecified number of parameters
Create a java source dynamically, compile and call
Launch an application from another application
Access the enclosing class from an inner class
Access inner class from outside
Use globally defined constants
Serialize an Object
Serialize an Object over a Socket
Easily remove my debugging code
Have a Singleton
Multiple expressions in for loops
Handle the List conflict (java.awt.List/java.util.List)
Use a generic toString()
Use a Object.clone()
Static field, constructor and exception
Use a Label break
Put printStackTrace() into a String
Iterate enum values
Array/Collection/Map/HashMap
Use a Hashtable
Scan the content of a hashtable
Sort an array
Initialize multidimensional array
Get array upperbound
Convert a String to an array or an array to a String
Sort Collection in reverse order
Resize an array
Dump array content (JDK1.5)
Initialize a static array
Sort an Hashtable
Eliminate "[unchecked] unchecked call ..." compiler warning
Sort on many fields
Optimize Collection usage
Sort an HashMap
Get keys corresponding to a value from a Map
Iterate a Collection and remove an item
Count distinct elements in a Vector
Dump the content of a Collection (JDK 1.5)
Initialize a Collection
Merge (or add) two arrays into one
Define an array (or Map, or ENUM) of functions
Join a List as a String
Properties/Preferences
Use an INI file (properties)
Load a properties file
Accentuated characters in Properties/ResourceBundle file
Have a multi-line value in a properties file
Use XML with Properties
Use the Registry to store informations
Sort Properties when saving
Language HowTo
If you find this article useful, consider making a small donation
to show your support for this Web site and its content.
Written and compiled by Réal Gagnon ©1998-2010
[
home
]