بالله ضروري احد يتكرم ويقول لي دا البرنامج ايش الخطأ فيه
import java.util.*;
public class Lap2 {
public static void main(String[] args) {
String fullName ,firstName ,lastName ,space ,middleName ;
space=new String(" ");
Scanner x;
x=new Scanner(System.in);
fullName=x.nextLine();
firstName=fullName.subString(0,fullName.indexOf(sp ace));
System.out.print(firstName);
fullName=fullName.subString(fullName.indexOf(space )+1,fullName.length());
System.out.print(fullName);
middleName=fullName.subString(0,1);
System.out.print(middlelName);
lastName=fullName.substring(fullName.indexOf(space ),fullName.length());
System.out.print(lastlName+" "+middleName+" "+firstName);
}
}