Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/351.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 我可以在Integer.parseInt(字符串\数组[0])中传递字符串的特定索引吗_Java_String_Algorithm_Wrapper - Fatal编程技术网

Java 我可以在Integer.parseInt(字符串\数组[0])中传递字符串的特定索引吗

Java 我可以在Integer.parseInt(字符串\数组[0])中传递字符串的特定索引吗,java,string,algorithm,wrapper,Java,String,Algorithm,Wrapper,我试图将String[]数组的特定索引转换为int String retdates[]=adates.split(" "); int ad =Integer.ParseInt(retdates[0]); 如果要将字符串转换为int,则intad=Integer.parseInt(//字符串值) 这意味着您只需要在parseInt方法中传递字符串参数。而parseInt是整数类的方法,因此它将是parseInt()而不是parseInt() 有关更多信息,请参阅文档。谢谢。。那有帮助

我试图将
String[]
数组的特定索引转换为
int

String retdates[]=adates.split(" ");
int ad =Integer.ParseInt(retdates[0]);

如果要将字符串转换为int,则
intad=Integer.parseInt(//字符串值)

这意味着您只需要在
parseInt
方法中传递字符串参数。而
parseInt
是整数类的方法,因此它将是
parseInt()
而不是
parseInt()


有关更多信息,请参阅文档。

谢谢。。那有帮助