如何获得“从员工中选择*”,“从薪水中选择*”,“从学生中选择*”和“从出勤中选择*”的输出

时间:2018-07-02 18:19:12

标签: java mysql

包数组;

公共类A {

public static void main(String[] args) {
    String[] arr = { "employee","salaries","student","attendance"};
    for (String x : arr)
    {
        System.out.println(x);
    }


}

} //输出: 雇员 薪水 学生 出勤

2 个答案:

答案 0 :(得分:0)

将System.out.println更改为

System.out.println("select * from " + x);

答案 1 :(得分:0)

system.out.println行缺少您期望的描述。您需要添加对帐单以便打印。下面是编辑后的代码。

package array;

public class A {

public static void main(String[] args) {
    String[] arr = { "employee","salaries","student","attendance"};
    for (String x : arr)
    {
        System.out.println("Select * from "+x);  // you need to edit this line
    }    
}