Advertisement
petur_stoqnov

Untitled

Apr 3rd, 2021
518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. public class test {
  2.     public static void main(String[] args) {
  3.         char myChar = 'l';
  4.         int  i = (int) myChar; // cast from a char to an int
  5.         System.out.println ("ASCII value - " + i);
  6.  
  7.         String finalString = "";
  8.         int round = 5;
  9.         while (round > 0){
  10.             finalString += i;
  11.             round--;
  12.         }
  13.         System.out.println(finalString);
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement