Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main
- {
- public static void main(String[] args) {
- String name = "Josif";
- int length_of_name = name.length();
- System.out.println("The name has length of: " + length_of_name);
- char middle = name.charAt(length_of_name / 2);
- System.out.println("Agent " + name + ", the middle character of your name is " + middle);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement