Why StringTokenizer and Scanner classes are not a part of java.io package but these belongs to java.util package?
Asked
Active
Viewed 630 times
-2
-
Because neither requires IO operations. They both can operate on regular `String`s. – resueman Jul 01 '16 at 13:23
-
InputStreamReader and BufferedReader altogether can operate on regular strings int the same way.Then why it was not included in java.io package – Priyankit Acharya Jul 01 '16 at 13:27
1 Answers
1
Because they're utility classes and not fundamental for IO in any way.

StuPointerException
- 7,117
- 5
- 29
- 54
-
please explain it.....as java.io package is for input and output purpose then why it was not included in java.io package – Priyankit Acharya Jul 01 '16 at 13:26
-
They are very useful helper classes which can be used as part of IO but are not primarily IO classes, it's a sensible abstraction. Having them in the IO package would be strange, since anybody using them for String parsing and manipulation would be mislead. – StuPointerException Jul 01 '16 at 13:31