how to convert ascii value of 49 to actual char in java
我的代码在下面,我正在尝试存储不是以前缀a或g开头的列表中的元素
void display(){
String[] inpArray={"apple","orange","grapes"};
LinkedList<String> listOne = new LinkedList<String>(Arrays.asList(inpArray));
LinkedList<String> listTwo = new LinkedList<String>();
listTwo.add("melon");
listTwo.add("apple");
listTwo.add("mango");
String[] result1 = {};
for(String res : listOne){
if(res.startsWith("a")||res.startsWith("g")){
System.out.println("--> "+res);
}else{
System.out.println("** "+res);
//result1 = res;//unable to store in string array or to list
// here i have to add all strings how to do that please help me
}
元芳怎么了
米脂
相关分类