please help me.
i dont know why this keeps happening
Program 21: Middle.java
Write a program that will receive a person’s full name in one String object (don’t read in 3 names). Then receive a second person’s full name. Print out whether the 2 people have the same middle name or not. Do this 3 times.
the error is: --------------------Configuration: <Default>--------------------
incompatible types
found : boolean
required: java.lang.String
String comparison= nametwo.equals(nameone);
^
1 error
Process completed.
import java.lang.String; import java.util.Scanner; public class Middle { public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.println("Please enter your full name"); String nameone=input.nextLine(); System.out.println ("Please enter another user's full name"); String nametwo=input.nextLine(); String comparison= nametwo.equals(nameone); if(nametwo.equals(nameone)) { System.out.println (nameone + "and" + nametwo + "have the same middle name"); } else { System.out.println (" The two names entered don't have the same middle name. "); } } }