Skip to content
February 8, 2009 / Narayan

Some String's Features

Here you can learn some of the features of the string which help in searching the words as wells.This String is written in Capital S because it’s a separate class can be found in java. The String have many function, it’s an array of the Character .

Some examples of String uses

– Serial numbers which is generated by the help of String .

Let’s start creating a java file named SymbolNo.java

public class SymbolNo {
	//----------
	//attributes
	//----------
	String symbol;
	String symbol2;

	//-----------
	//CONSTRUCTOR
	//-----------
	public SymbolNo() {
		symbol = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
		symbol2 = "013479121564568418542458141231654648456484";
	}

	//----------
	//METHOD
	//----------

	//method declare to loop and display
	public void loopChar(){
		for(int i = 0; i<26; i++){

			//creating string subStr for creating looped string of symbol2
			String subStr = symbol2.substring(i, (i+8));

			//displaying symbol
			System.out.println(subStr + symbol.charAt(i));

		}

	}

	//MAIN METHOD
	public static void main (String[] args) {
		SymbolNo obj = new SymbolNo();
		obj.loopChar();

	}

}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: