Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

indexOf() of String

 
mi te
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why the method of String, int indexOf(int ch), takes in an argument of type int? Why not the type char?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess: a historical mistake. Similar routines in the C language standard library take int arguments.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic