Code.GeekInterview.com
  I am new, Sign me up!
 
Code Samples Java
 

Character string to byte conversion


Code ResourceAuthor: Kiran.jakkaraju  

Difficulty Level:

Published: 17th Nov 2006   Read: 1894 times  

Filed in: Java
Add Comment


 


Input a string , example "kiran"; the code will convert to byte. You can put the code in a function and pass parameter as string and return byte.

 


Sample Code
  1.  
  2. String x =""kiran"";
  3.  
  4.   char a[]= x.toCharArray();
  5.  
  6.   for(int i=0;i<x.length();i++){
  7.    
  8.    System.out.println(a[i]);
  9.    System.out.println((byte)a[i]);
  10. }
  11.  
Copyright GeekInterview.com


Next Article: Building an Ajax based chat room in ASP.NET


 

Latest Code Samples

 

Popular Code Samples

 

Related Code Samples

 

Post Comment


Members Please Login

Name:  Email: (Optional. Used for Notification)

Title:
 
Comment:
Validation Code: <=>  (Enter this code in text box)





Popular Coders

# Coder NameHits
1. iamdvr35754
2. venki_madesh30854
3. srinivasaraobora22483
4. bora_srinivasarao11732
5. Kiran.jakkaraju4610
6. parmod kumar duhan4502
7. chowsys3972
8. Venkateswara Rao3714
9. Raju3393
10. Vamshidhar Matam2290

Active Coders

Refined Tags

 

Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact  

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape