-2

Why StringTokenizer and Scanner classes are not a part of java.io package but these belongs to java.util package?

1 Answers1

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