
Since 1998, DevX has helped people start businesses, build websites, and provide enterprise technology to people globally. Interviewing the likes of Microsoft’s co-founder, Steve Ballmer, the publication brings comprehensive, reliable, and accessible insights to the Internet.
The following methods can be used for creating new instance of your classes, depending on your specific needs. import java.lang.ClassLoader;import java.net.URLClassLoader;import java.net.URL;public class InstantiateClass { testFinally newInstance() throws Exception {
Using the -verbose option during compilation and execution is very helpful—both for obtaining more information about the classes being loaded by the compiler and the interpreter and to find out
Once you are finished iterating through the values of an Object implementing the Enumeration interface, the next time youtry to use hasMoreElements() it will return false. Many developers are not
Use the fillInStackTrace() method to rethrow a Throwable type of exceptional condition in your code. This is useful if you want to rethrow a exception occurred while using a method
Validating user input that is typed into a JTextField can becumbersome, especially if the input string must be converted to anumeric value such as an int. By subclassing JTextField, however,
The SELECT INTO statement is a combination of the SELECT and INSERT T-SQL commands, that lets you create a new table from a subset of the rows and/or the columns
The keywords false and true are Boolean literals that evaluate to 0 and 1 respectively. Note that in other programming language, VB for instance, false equals -1 and true equals
C++ allows casting a pointer to member functions of one type to another pointer to member, as long as the signatures of the two match. However, the results of such
Here’s a topic that was recently discussed at the Standardization committee. Suppose we have the following enum type: enum Stat { good, bad}; Is it legal to use the enumerator
Does your C++ compiler accept the following code? char s[3]=”abc”; // illegal in C++, no place for ” The standard requires that the size of a char array initialized with
The implementation ensures that functions having an exception specification should throw only exceptions that are listed in their exception specification. For example: class X{};class Y{};void f() throw X{ throw Y();
In a previous tip, http://www.devx.com/free/tips/tipview.asp?content_id=1585 , I explained the concept of lvalues and rvalues. Binding a reference to an rvalue is allowed as long as the reference is const. The
The name of the executable is stored in the string argv[0]. To access it, declare your main() function as follows: int main(int argc, char ** argv) Even if the application
It may be tempting to squeeze an extra pint of performance by removing all debug information from the release version. However, it’s recommended to leave minimal debugging info even in
The interface of a class consists of its public members. Usually, private members represent implementation details and are not exposed to other classes and users. Private members can be member
Question: Does “Connection.setAutoCommit(false)” mean “begin a transaction?” Answer: By default, JDBC connections start in autocommit mode. This means that every executed statement is treated as a separate transaction. A transaction
Question: Suppose a client of a Web application logs in using a login-handler servlet, and then some back-end operations using EJBs need to be performed. Can I store the initial
Question: What is the difference between a JavaBean and an Enterprise JavaBean? Answer: It is natural to be confused regarding the relationship between JavaBeans and Enterprise JavaBeans (EJBs), because they
Question: If ResultSet is an interface, then why can we call methods like next(), isLast() etc. without defining the method body anywhere in the program? As I understand it, in
Question: What is the reason that allocated memory should be explicitly deallocated ? Is there any difference in the way the data with different storage types (stack, heap, static memory)
Question: Is there a function that can convert upper case to lower case and vice-versa? Answer: The toupper() and tolower() functions are declared in the standard header. Each of them
Question: I am currently writing a program that uses multidimensional arrays to store and display data items. My problem is that I cannot seem to change the array values from
Have you ever spent your time trying to arrange too many controls on a form that was too small for all of them? Now you can relax, at last. Just
In general, a browser can’t render an HTML table before the closing &/TABLE> tag is received. This means that the end user might wait for several seconds before a table
You can access a lot of useful information through the ServerVariables collection, but this has a price in terms of performance. More precisely, the first time you reference this collection
The Server.MapPath method slightly shows down the execution of your ASP scripts, because IIS has to access some internal variables. For this reason you should try to avoid it if
When you perform a complex and time-consuming query in your ASP program, you should periodically test whether the client is still connected, using the IsClientConnected method of the Response object,
You can speed up ASP by adding the following statement at the beginning of an ASP page: Response.Buffer = True This statement must be executed before any HTML text is
As most ADO developers know well, there are basically two distinct syntax for opening a Connection and then a Recordset: you can explicitly create and open a Connection object, and
Question: I’m trying to use the Advanced Find feature of Outlook to locate attachments that contain a specific word (analogous to the Containing Text feature of Windows’ Find feature). I











