CORE API / NOTES</>↗Core API06 May 2010
A StringBuffer is like a String, but can be modified. StringBuffer are safe for use by multiple threads. The methods are synchronized where necessary so that all the operations on any particular instance behave as if they occur in some serial order that is consistent with the order of the method calls made by each […]
JDBC / NOTES</>↗JDBC05 May 2010
Fetch size is the number of rows that should be fetched from the database on a single database network trip. When more rows are needed, another request is sent by the application to the database server. Setting the correct fetch size will help our program to perform better by reducing the network communication generated between […]
CORE API / NOTES</>↗Core API02 May 2010
package org.kodejava.lang; public class StringBufferInsert { public static void main(String[] args) { StringBuffer buffer = new StringBuffer("kodeava"); System.out.println("Text before = " + buffer); // |k|o|d|e|a|v|a|…. // 0|1|2|3|4|5|6|7|… // // From the above sequence you can see that the index of the // string is started from 0, so when we insert a string in // […]
CORE API / NOTES</>↗Core API02 May 2010
The example below show you to remove some elements of the StringBuffer. We can use the delete(int start, int end) method call to remove some characters from the specified start index to end end index. We can also remove a character at the specified index using the deleteCharAt(int index) method call. package org.kodejava.lang; public class […]
CORE API / NOTES</>↗Core API29 Apr 2010
The chartAt() method of the String class returns the char value at the specified index. An index ranges from 0 to length() – 1. If we specified an index beyond of this range a StringIndexOutOfBoundsException exception will be thrown. These method use zero based index which means the first char value of the sequence is […]
REGEX / NOTES</>↗Regex28 Apr 2010
If you want the entire string to match your regular expression pattern you can use the Matcher.matches() method. This method will return true if and only if entire input string matches with the matcher’s pattern. If the pattern only needs to match the beginning of the string you can use the Matcher.lookingAt() method. You can […]