К сожалению, моё решение... правильным совершенно не является.
Как бы вы, уважаемые члены комьюнити, взирая на богатый опыт, поступили?
package com.javarush.task.task04.task0421;
/*
Настя или Настя?
*/
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader p = new BufferedReader(new InputStreamReader(System.in));
String l = p.readLine();
String k = p.readLine();
if (l == k)
System.out.print("Имена идентичны");
InputStreamReader t = new InputStreamReader(System.in);
int a = t.read();
int b = t.read();
int c = t.read();
int d = t.read();
int f = t.read();
int g = t.read();
int h = t.read();
int j = t.read();
int n = t.read();
int m = t.read();
int z = a+b+c+d;
int x = f+g+h+j+n+m;
if (z == x)
System.out.print("Длины имен равны");
}
}