public class Contains1{
static String str = "abc";
public static void main(String[] args) {
Contains1 con = new Contains1();
char[] b =method();
method1(b);
}
static char[] method() {
char[] B = str.toCharArray();
return B;
}
public static void method1(char[] ch){
System.out.print("{");
for (int i = 0; i < ch.length; i++) {
if(i!=ch.length-1){
System.out.print("'"+ch[i]+"'");
}else{
System.out.print(ch[i]+"}");
}
}
}
}
|
|