Findryan

Untitled

Nov 15th, 2016
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. class Tujuh
  2. {
  3. public static void main(String[] args)
  4. {
  5. String str="Teknik Informatika UTS";
  6. char[] arraystr=str.toCharArray();
  7. System.out.println("String : " +str);
  8. System.out.println("String Baru [toCharArray]: ");
  9. for (int i=0; i<arraystr.length ; i++)
  10. {
  11. System.out.println(arraystr[i]);
  12. }
  13. System.out.println("String Baru [getChars]: ");
  14. char[] getstr=new char[10];
  15. str.getChars(5,13,getstr,0);
  16. for (int i=0; i<getstr.length ; i++)
  17. {
  18. System.out.println(getstr[i]);
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment