StringBuffer is used to store character strings that will be changed (String objects cannot be changed). It automatically expands as needed. Related classes: String, CharSequence.
StringBuilder was added in Java 5. It is identical in all respects to StringBuffer except that it is not synchronized, which means that if multiple threads are accessing it at […]
Entries Tagged as 'Programming'
Core Java: StringBuffer and StringBuilder
May 15th, 2008 · No Comments · Java
Tags:Java·string·stringbuffer·stringbuilder
Core Java: marker interface
May 15th, 2008 · 2 Comments · Java
A marker or tagging interface is an interphase with no methods. It can be created by ANYBODY. the purpose of these interfaces is to create a special type of Object, in such a way that you are restricting the classes that can be cast to it without placing ANY restrictions on the exported methods that […]
Tags:clonable·Java·marker interface·serializable
Building DOM tree by reading an xml file in Java
December 19th, 2007 · No Comments · Java, Source Code
import java.io.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import org.xml.sax.*;
public class BasicDom {
public static void main(String[] args) {
Document doc = parseXmlFile(”infilename.xml”, false);
}
// Parses an XML file and returns a DOM document.
// If validating is true, the contents is validated against the DTD
// specified in the file.
public static Document parseXmlFile(String filename, boolean validating) {
try {
// Create […]
Tags:
Cross Browser Compatability - Web Resources
July 27th, 2007 · No Comments · Java Script
http://www.zvon.org/xxl/xhtmlReference/Output/comparison.html compares Strict and Transitional XHTML
http://www.w3schools.com/ is a great web site for learning different web technologies
http://www.quirksmode.org/dom/compatibility.html covers W3C DOM compatibility among different browsers and platforms
http://www.w3schools.com/browsers/browsers_stats.asp provides up to date browser usage statistics
http://nexgenmedia.net/evang/iemozguide/ provides migration guide from Internet Explorer to Mozilla
http://www.w3.org/QA/Tools/#validators provides links for W3C (X)HTML/CSS validators.
Bookmark it!
These icons link to social bookmarking sites where readers […]
Tags:
Oracle Specific SQL Concepts - Part 1
July 24th, 2007 · No Comments · Pl/SQL
Some of the new concepts introduced as a part of Oracle new releases are:
Analytical Functions
In addition to the normal aggregate function like Max() etc. Oracle came up with some more commonly useful analytical functions, which can be implemented by PL/SQL logic. Mainly 5 commonly used functions are there:
rank() :– In a select statement after selecting […]
Tags:
Introduction to PHP’s PEAR classes : Comparing normal Database connections with PEAR classes.
July 14th, 2007 · No Comments · PHP, Programming
PHP Database Abstraction:
Abstraction is a technique which simplifies something complex. It does this by removing non-essential parts of the object, allowing us to concentrate on the important parts.
PEAR’s DB classes are one such database abstraction layer, and in this article we’ll take a look at some traditional database access methods and then compare them with […]
Difference between String str=”abc” and str=new String(”abc”)?
May 25th, 2007 · 5 Comments · Java, Placements
1) using new operator:- String st=new String(”abc”);
2) Without using new operator:- String st=”abc”;
Once string object is created with or without new operator contents of string object cannot be modified. But we can modify String reference variable. when you are trying to modify string objects ie.. concatinating,repalcing etc.. a new […]
Tags:
Difference between require and use ?
May 23rd, 2007 · No Comments · Perl
Perl offers several different ways to include code from one file
into another. Here are the deltas between the various inclusion
constructs:
1) do $file is like eval `cat $file`, except the former:
1.1: searches @INC and updates %INC.
1.2: bequeaths an *unrelated* lexical scope on the eval’ed code.
2) require $file is like do $file, except the former:
2.1: […]
Tags:
Bubble Sort
April 15th, 2007 · No Comments · Algorithms, C/C++, Source Code
The source code for bubble sort.
#include
#define NUM 6
void swap(int arr[], int i, int j) {
int tmp = arr[i];
arr[i] = arr[j];
arr[j] = tmp;
}
main() {
int arr[NUM],i,j;
// start reading nums
for(i=0;i
Tags:
Shell Sort
April 15th, 2007 · No Comments · Algorithms, C/C++, Source Code
Source code for shell sort is provided below.
#include
#define NUM 6
main() {
int arr[NUM],i,j, incr=2;
// start reading nums
for(i=0;i
Tags:















