Advertisement
Josif_tepe

Untitled

Oct 30th, 2024
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. public class Main
  2. {
  3.     public static void main(String[] args) {
  4.          String name = "Josif";
  5.  
  6.         int length_of_name = name.length();
  7.         System.out.println("The name has length of: " + length_of_name);
  8.  
  9.         char middle = name.charAt(length_of_name / 2);
  10.         System.out.println("Agent " + name + ", the middle character of your name is " + middle);
  11.     }
  12. }
  13.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement