StringCharacterIterator clone Example

StringCharacterIterator class clone example. This example shows you how to use clone method.


StringCharacterIterator class clone example. public Object clone() Creates a copy of this iterator.

Here is the code
/*
 * @ # Clone.java
 * A class repersenting use to clone method of
 * StringCharacterIterator class in java.text package
 * version 13 June 2008
 * author Rose India 
 */

import java.text.*;

public class Clone {

    public static void main(String args[]) {

        StringCharacterIterator s = new StringCharacterIterator("Roseindia");

        //  Creates a copy of the iterator.
        StringCharacterIterator s1 = (StringCharacterIterators.clone();

        //Display iterator
        for (char ch = s1.first(); ch != CharacterIterator.DONE;
                ch = s1.next()) {
            System.out.print(ch);
        }
    }
}

Output
Roseindia

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US