Advertisements
Advertisements
प्रश्न
The Scanner class method used to accept words with spаce:
विकल्प
next()nextLine()Next()nextString()
MCQ
Advertisements
उत्तर
nextLine()
Explanation:
The nextLine() method reads the entire input string, including spaces, until it hits the end of the line (when Enter is pressed). In contrast, the standard next() method stops reading at the very first space it encounters.
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 5: Library Classes - Exercises [पृष्ठ १३४]
