I have entered the string abc def and the equals() has returned true while comparing the entered string with the given string abc.
import java.util.Scanner;
class StringManipulation
{
public static void main(String args[])
{
Scanner s = new Scanner(System.in);
System.out.println("enter username");
String a = s.next(); // abc def
System.out.println(a.equals("abc")); // return true at execution time
}
}