Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to use StreamTokenizer?  RSS feed

 
Hemant Agarwal
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using StreamTokenizer. First of all I want to know if it is legal to use that class or is it depreceated?

Where to use it?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To find out if a class, interface or method is deprecated, you look it up in the API documentation. The documentation does not say the class is deprecated. One of its contructors is, however.

"Where to use it?" - What do you mean by that?
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While the class isn't formally depracated, its API states:

StringTokenizer is a legacy class that is retained for compatibility reasons
although its use is discouraged in new code. It is recommended that anyone
seeking this functionality use the split method of String or the
java.util.regex package instead.

Hmmm...
 
Paul Clapham
Sheriff
Posts: 22487
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeff Albrechtsen:
While the class isn't formally depracated, its API states:

StringTokenizer is a legacy class that is retained for compatibility reasons
although its use is discouraged in new code. It is recommended that anyone
seeking this functionality use the split method of String or the
java.util.regex package instead.

Hmmm...
But the question was about StreamTokenizer... a class only a compiler writer could love.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Woops! Time for me to get glasses. Maybe I should get a cool perscription
pair like Stan Lee's:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!