万能百科  > 计算机   > 

[填空题] 本题是判断一个字符串“Tom”是否在另外一个字符串“I am Tom, I am from China”中出现。 public class jav

2021-07-20   

[填空题] 本题是判断一个字符串“Tom”是否在另外一个字符串“I am Tom, I am from China”中出现。

public class java1

public static void main(String[]args)

______;

str1="I am Tom, I am from China.";

str2="Tom";

int i=______;

if(______)

System.out.println("""+str2+"" is in the string:""+str1+""");

else

System.out.println("""+str2+""is not in the string:""+str1+""");

正确答案:

第A处:String strl,strB 第B处:strA.indexOf(strB) 第C处:i!=-A

词条内容仅供参考,如果您需要解决具体问题
(尤其在法律、医学等领域),建议您咨询相关领域专业人士。

标签