Problem with underscore(_) in Collections.binarySearch (Java)

Posted by Alex Cheng on Stack Overflow See other posts from Stack Overflow or by Alex Cheng
Published on 2010-04-26T14:44:50Z Indexed on 2010/04/26 15:03 UTC
Read the original article Hit count: 123

Filed under:
|
|
|

Hi all.

Problem:

I am using Java Tutorials™ sourcecode for this. This is the source code.

I tried this:

--following with another section of sorted words--
words.add("count");
words.add("cvs");
words.add("dce"); 
words.add("depth");
--following with another section of sorted words--

and it works perfectly. However when I use this:

--just a section of sorted words--
words.add("count");
words.add("cvs");
words.add("dce_iface"); 
words.add("dce_opnum");
words.add("dce_stub_data");
words.add("depth");
--following with another section of sorted words--

It does show dce_iface when I type dce, but when I type _ then following with o or s it shows me something else like dce_offset where the offset comes from words.add("fragoffset"); somewhere in the list.

What can I do to solve this problem? Thank you in advance.

© Stack Overflow or respective owner

Related posts about java

Related posts about collections