如何获得“select*from employee”、“select*from palaries”、“select*from student”和“select*from attention”输出

c9qzyr3d  于 2021-06-20  发布在  Mysql
关注(0)|答案(2)|浏览(313)

关闭。这个问题需要细节或清晰。它目前不接受答案。
**想改进这个问题吗?**通过编辑这个帖子来添加细节并澄清问题。

两年前关门了。
改进这个问题
封装阵列;
公共a级{

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

}//输出:员工工资学生出勤

nbnkbykc

nbnkbykc1#

system.out.println行缺少所需的描述。您需要添加要打印的语句。下面是经过编辑的代码。

  1. package array;
  2. public class A {
  3. public static void main(String[] args) {
  4. String[] arr = { "employee","salaries","student","attendance"};
  5. for (String x : arr)
  6. {
  7. System.out.println("Select * from "+x); // you need to edit this line
  8. }
  9. }
1rhkuytd

1rhkuytd2#

将system.out.println更改为

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

相关问题