I'm getting wrong String value
void displayId(PrintWriter stdOut, StringResources resources, IPatchBundle group, String[] ids){
for(int i=0;i<ids.length;i++)
System.out.println("Mids from cmdMds"+ids);
}
The above code produces [Ljava.lang.String;@152cf21
.
I tr开发者_如何学JAVAied putting .toString()
too, still getting the same. Please help me to get the actual value.
Change
System.out.println("Mids from cmdMds"+ids);
To
System.out.println("Mids from cmdMds"+ids[i]);
You're trying to print the whole array each time, not the individual elements.
Try:
System.out.println("Mids from cmdMds"+ids[i]);
You want to print the array elements ids[i]
, not the array itself ids.toString()
.
[Ljava.lang.String;@152cf21
is decoded as:
[
- arrayL
- of objectjava.lang.String
- with class java.lang.String;
- end of type signature@152cf21
-hashCode()
as hex
Try:
System.out.println("Mids from cmdMds"+ids[i]);
精彩评论