Release Resources with a Shutdown Hook
JDK 1.3 introduced the addShutdownHook() method to the java.lang.Runtime class. Implementing a shutdown hook is useful if you need to take some action right before your app stops running. To
JDK 1.3 introduced the addShutdownHook() method to the java.lang.Runtime class. Implementing a shutdown hook is useful if you need to take some action right before your app stops running. To
The following is a powerful UNIX command that searches for files or folder names containing a particular pattern:1 $>grep -l “main(String” `find . -name *.java -print` This particular code will
There are times you don’t want your output to be cached on browsers. For instance, when a user is viewing their account balance, you want the data to be retrieved
The failure to deallocate previously allocated memory is known as a memory leak. A memory leak is one of those hard to detect bugs, and it may cause unpredictable behavior
Naming variables has a major effect on how hard it will be for a person to follow the code, whether it is the same person who wrote it or someone
Here’s an example: Code For Balance Class——————————————————————————–// Demo class for User-Defined Exceptions To Ensure The// Validity of Data Contained In A Classimport java.io.*;public class Balance{ int bal; public Balance(){ }
This small routine creates a link from all the tables of one .mdb file to another. First, you need to select reference ‘Microsoft ADOX’, your available version. Private Sub CreateLinkTables()
There are two methods to send info and get a response via HTTP. The second (alternate) method works for both .NET and VB6, but it requires DLL reference (take your
When you compile a program the compiler first uses a preprocessor to analyze the code. The #define directive can be used to either define a constant number or function or