Hello guys ;
I have a question in java . is it possible to great a method in java program that :
if ( user press "Enter" )
do some thging
I tried this simple examples , but dosn't work with me
Scannaer in = new Sccanner (System.in ) ;
String name = in.next ();
if (name.equals("")) // which I men If user press "Enter"
System.out. println("you did not entered any name for example !! ");
// also I tryed
if (name.equals(null)
// or
//do some thing
// but both dosn't work !!
Could any body help me how to great a method in Java
if user press "Enter "
{
statements
}
Thank you for reading it