I find out a quesiton, only record it, when i have time, i will study it.
package com.patsnap;
import java.util.Arrays;
import java.util.List;
public class TestListChar {
public static void main(String[] args) {
char[] arr = {',','-','-','?'};
List<char[]> list = Arrays.asList(arr);
char c = '?';
if (list.contains(c)) {
System.out.println("char");
}
String[] arrStrings = {"-",",","?"};
List<String> list2 = Arrays.asList(arrStrings);
String s = "?";
if (list2.contains(s)) {
System.out.println("string");
}
}
}
The output is : string.
The question is: why list.contains(c) is false?
分享到:
相关推荐
Don't forget that this document is only a quick introduction and that it is not a complete tutorial about LUA. How to embed LAU into C++? Another way to formulate this question : "How can I use ...
Maintaining a uniform style and following conventions means that we can more easily use "pattern-matching" to infer what various symbols are and what invariants are true about them. Creating common, ...
[] 匹配中括号里的内容[a-z][A-Z][0-9]。 ! 事件。 $ 取环境变量的值。 | 管道。把前一命令的输出作为后一命令的输入,把几个命令连接起来。 |经常跟tee连用,tee 把内容保存到文档并显示出来。 三、通用后...
If you still have a question and need assistance, help is available from the following sources: 1. Type GO BPROGB on the CompuServe bulletin board system for instant access to the Borland forums ...
If you still have a question and need assistance, help is available from the following sources: 1. Type GO BPROGB on the CompuServe bulletin board system for instant access to the Borland forums ...