
Optimizing String Classes in Java Code
The String class is probably one of the most used classes in Java. String concatenation via the
The String class is probably one of the most used classes in Java. String concatenation via the
Java has some strict rules for exception handling when it comes to inheritance and overriding of methods.Consider this example: class Base { void amethod() { }}class Derv extends Base{ void amethod() throws Exception { } //compile-time error public static void main( String s[] ) { Base b = new Derv();
We often come across situations where we have to rank things/persons based on certain criteria, such as ranking Students based on their scores.Take, for example, a SCORES table with two columns: STUDENT_IDVARCHAR2(10), SCORE NUMBER(5). To rank these Students based on their scores, a straightforward approach is to open a cursor,
A compact way of handling null database fields is as follows: txtText1.text = Format(rs!Field) If rs!Field is null, Format(rs!Field) will resolve to an empty string.Otherwise the value in the recordset field will be entered into the text box. This behavior of Format() is rarely noticed but is useful because it
Handle dialogs with one line of code by encapsulating the show method within the form in a public function. This makes the form/dialog reusable and simpler to implement and update. Example: Form: frmLogin Option Explicit Public Enum LoginReturns LoginFailed = 0 LoginSuccess = 1 End Enum Private mReturn As Long
An alternate, convenient way to view recordsets in debug mode is to persist a recordset to disk using rs.save MyFileUNC.ADTG in the immediate window. Note that the file must be of ADTG type (*.adtg). The recordset may then be viewed on a grid in the same application (or on a
This tip can be used as a Select Case statement with a MsgBox statement. Because a variable is not used to hold the response, adding one or more handles for response is easy. The statement renders a simple overview of the function of the code. Here is an example: Select
Shipping custom controls with their own set of popup menu items make the controls appear appropriately professional. They add ease of use, functionality and value to the control(s). Here’s how it can be done:Add an invisible menu item to the control with one or more sub-menu item(s). The sub-menu item(s)