I know that in c++ in order to read a string like. you need to usePHP Code:
Fahman Khan
. In java, I have noticed that usinggetline(cin,string variable)automatically reads the whole line...Suppose I wanted to read the first name only, how would I be able to accomplish that?String name=keyboard.nextLine()