Get all updates of Java4s
Follow Us: Email Newsletter

How to Convert String to char Array in Java

Core Java » On Oct 14, 2016 By Sivateja

In java we have built-in function String.toCharArray() to convert String to char array. But for sure in the interviews they will ask you to write a program to convert string to char array without using the built-in functions :-) I will show you how..

String to char Array Using Java Built-in Function

String to char Array Without Using Built-in Function

 

Output :

J
a
v
a
4
s

Choose whichever you need ;)

You Might Also Like

  ♦ About Author ♦

Java4s_Author
sivateja@java4s.com
Full Stack( Java/J2EE & UI/UX ) Developer and founder of Java4s - Get It Yourself, A popular Java/J2EE Programming Blog. Sign-up for the Email Newsletter for your daily dose of Java tutorials.

Comments

Name*
Mail*
Website



By posting your answer, you agree to our comments policy.
What would you like to learn today?
Browse these popular technologies
Hibernate spring struts Servlets ajax Log4j jQuery Json Core Java Web Services AngularJs
Most Recent Tutorials
Hibernate_Logo Hibernate Recent Posts Spring_Logo Spring Recent Posts Struts_Logo Struts Recent Posts
Useful Links Current & UpComing Tutorials
Upcoming
  Web Services [ SOAP ], JSP
Contact | About Us | Privacy Policy | Advertise With Us

© 2010 - 2016 Java4s - Get It Yourself.
The content is copyrighted to Sivateja Kandula and may not be reproduced on other websites.