Can we compare scanner and String | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Can we compare scanner and String

Can we compare scanner and String in java

29th Sep 2017, 3:52 AM
Raghav Khullar
Raghav Khullar - avatar
2 Answers
+ 7
Yes
29th Sep 2017, 7:17 AM
Marvin
Marvin - avatar
+ 4
There is nothing to compare a Scanner and String to. A Scanner is an Object used for file/input reading. A String is an Object that is used for a sequence of characters. There is no relationship between the two that can equate to any meaningful comparisons. I assume this isn't actually what you meant to ask; so, can you provide an example?
29th Sep 2017, 4:18 AM
Rrestoring faith
Rrestoring faith - avatar