Tip Bank

DevX

Recursion

Question: Is it possible to make recursive subroutine calls in Java? Answer: Yes, you can make recursive method calls in Java.Just make sure you have a termination condition to avoid

DevX

Saving Object to File

Question: Is it possible to save an object (in my case a collection) directly to a file, or must one extract the object’s properties and save each individually? Answer: Visual

DevX

Closing an application from another app

Question: How do I use one application to close another application in Windows 95? I need to overwrite a loaded DLL, so I have to close the application that loads

DevX

Mandatory exception handling

Question: Why should some of the statements that might throw an exception be in try/catch block (otherwise the compiler reports a syntax error), and some need not be, even though

DevX

Java and Dual Monitor Unix Workstations

Question: I have a question regarding use of dual monitorUnix workstations to display Java screens.Specifically, can I display the mainscreen on onemonitor and the popup on another monitor? Answer: Within

DevX

Closing an application

Question: When I press the Close button on my app’s main form, the program appears to end. When I look at the Windows task list, however, my app is still

DevX

Dynamic memory allocation

Question: How do you dynamically allocate memory for a two-dimensional array? This is what I had, and my g++ compiler didn’t like it: int **m;m= new int [100][100]; Answer: Yep.

DevX

Exception to String

Question: Given an exception, how do I convert the stack trace into a string? I want to capture the entire contents, the message and the trace, to a string. Answer:

DevX

Text Area and Cursor Control

The java.awt.TextComponent class (from which TextArea is derived) has three methods to retrieve mouse selection information. The getSelectedText() method will return a String containing the selected text, and the getSelectionStart()