The only string in the list is "Java". If you search for "PHP" from here, the return value is null. The original code for this exercise returns null only when nothing is found. What the caller wants ...
An array in Java is a container object that holds a fixed number of values of a single type. The length of an array is established when the array is created and cannot be changed.
本内容遵循CC 4.0 BY-SA版权协议 周五晚上,小刘抱着电脑来找我:“杨工,我改一个对象里的列表,结果另一个对象也跟着变了,这是见鬼了吗?” 我笑了:“没见鬼,你这是浅拷贝。” 第一幕:搬家那天 小刘租的房子到期,要搬去新小区。 他有两样东西: ...
一覧に入っている文字列は"Java"だけ。ここから"PHP"を探すと、戻り値はnull。今回の元コードは、何も見つからなかったときだけnullを返します。呼び出す側が欲しいのは、要素が0個のリストです。 では、入力のnullや空白だけの検索語も、空リストに変えてよいでしょうか。検索語を渡し忘れた ...
Some results have been hidden because they may be inaccessible to you
Show inaccessible results