我能够找到用双引号打印字符串的示例,但我需要String
动态地将变量值输入到查询中。
例如检查我的java代码波纹管
public class TestClass {
static String[] array = {"bug", "new Feature"};
public static void main(String args[]){
for(String string:array){
String query = "project = TST AND issuetype = " +"\"string\"";
System.out.println(query+"\n");
}
}
}
当我运行这个程序时,我得到了类似的输出
project = TST AND issuetype = "string"
project = TST AND issuetype = "string"
但我想要这样的结果
project = TST AND issuetype = "bug"
project = TST AND issuetype = "new Feature"
提前致谢