









Preparing a Log File With the Least File Operations
In a big project involving several classes, logging error messages can be required. There are several ways to do this, but a simple approach is to open the log file
In a big project involving several classes, logging error messages can be required. There are several ways to do this, but a simple approach is to open the log file
A generic approach to making sure a single quote (‘) does not cause a SQL statement to fail is to replace the single quote with two single quotes, as in
The Collections class provides static APIs to generate read-only orunmodifiable collections, lists, sets, or maps from specified entities. For instance, if you are sure that the ArrayList you’ve made should
Use the java.lang.Runtime run a program in a separate process.Here
When you are typecasting and using instanceof keyword in Java, there are several things you should keep in mind. Consider the following example program: class Point { int x, y;
Following are some tips for matching the most commonly used data structures with particular needs.1. When to use a Hashtable?A hashtable, or similar data structures, are good candidates if the
By using MACRO definitions, you can easily write lines of code that are only included in Debug versions and not in Release versions. For instance, if you create a function
The java.net.HttpURLConnection class provides HTTP specific functionality. First you need to open an HttpURLConnection: URL url = new URL(
Some programmers believe that int a[] and int * a are equivalent.Also some C++ books to say that pointers and arrays are almost same. This belief usually leads to hard