The current() method of java.text.StringCharacterIterator class in Java is used to get the current character that is to be read by this StringCharacterIterator. This method returns that current character.
Syntax:
public char current()
Parameter: This method do not accept any parameter.
Return Value: This method returns the current character that is to be read by this StringCharacterIterator.
Exception: This method do not throw any Exception.
Program:
// Java program to demonstrate// the above method import java.text.*;import java.util.*; public class StringCharacterIteratorDemo { public static void main(String[] args) { StringCharacterIterator stringCharacterIterator = new StringCharacterIterator( "GeeksForGeeks"); System.out.println("Current character: " + stringCharacterIterator .current()); }} |
Current character: G
Reference: https://docs.oracle.com/javase/9/docs/api/java/text/StringCharacterIterator.html#current–

… [Trackback]
[…] There you can find 9646 more Information on that Topic: geeksforgeeks.org/stringcharacteriterator-current-method-in-java-with-examples/ […]
… [Trackback]
[…] There you can find 56624 additional Info on that Topic: geeksforgeeks.org/stringcharacteriterator-current-method-in-java-with-examples/ […]
… [Trackback]
[…] Read More Information here on that Topic: geeksforgeeks.org/stringcharacteriterator-current-method-in-java-with-examples/ […]
… [Trackback]
[…] Find More here on that Topic: geeksforgeeks.org/stringcharacteriterator-current-method-in-java-with-examples/ […]
… [Trackback]
[…] Find More to that Topic: geeksforgeeks.org/stringcharacteriterator-current-method-in-java-with-examples/ […]