Wednesday, 30 March 2016

Java Tutorial : Java String [toCharArray() method]


Click here to watch in Youtube :
https://www.youtube.com/watch?v=WSC-AXsho9E&list=UUhwKlOVR041tngjerWxVccw

Click the below Image to Enlarge
Java Tutorial : Java String [toCharArray() method] 
ToCharArrayDemo.java
/*
 * public char[] toCharArray()
 * 
 * 
 * Returns: 
 * --------
 * 
 * a newly allocated character array whose length is the
 * length of this string and whose contents are
 * initialized to contain the character sequence
 * represented by this string.
 */
public class ToCharArrayDemo
{

    public static void main(String[] args)
    {
        String str = "Welcome";
        char[] charArray = str.toCharArray();
        for (char c : charArray)
        {
            System.out.println(c);
        }
    }

}
Output
W
e
l
c
o
m
e
Click the below link to download the code:
https://sites.google.com/site/javaee4321/java/StringDemo_toCharArray_App.zip?attredirects=0&d=1

Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/StringDemo_toCharArray_App

Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/89dfdef018d2970576505c9f498b5e4f28628c35/BasicJava/StringDemo_toCharArray_App/?at=master

See also:
  • All JavaEE Viedos Playlist
  • All JavaEE Viedos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • No comments:

    Post a Comment

    Google+ Followers

    Google+ Badge