Java 我需要帮助打印此数组中的元素吗?
然后,我输入:学校用品,其中有6个元素属于该类别,输出按如下方式打印 以下是我们对该类别的发现:Java 我需要帮助打印此数组中的元素吗?,java,arrays,Java,Arrays,然后,我输入:学校用品,其中有6个元素属于该类别,输出按如下方式打印 以下是我们对该类别的发现: "Please enter the category you are looking for." 我想显示的项目以及不只是类别 这是我正在查看的阵列 School Supplies School Supplies School Supplies School Supplies School Supplies School Supplies
"Please enter the category you are looking for."
我想显示的项目以及不只是类别
这是我正在查看的阵列
School Supplies
School Supplies
School Supplies
School Supplies
School Supplies
School Supplies
System.out.println(“这是按类别类型列出的列表”);
System.out.println(“请输入您正在查找的类别”
+“为了。”);
字符串搜索=用户输入。下一步();
println(“以下是我们为该类别找到的:”);
for(int row=0;row
School Supplies
School Supplies
School Supplies
School Supplies
School Supplies
School Supplies
String[][] store = {
{"Alumni Drink ware", "Gifts", "$25.00"},
{"Binders", "School Supplies", "$3.00"},
{"Book bag", "School Supplies", "$20.00"},
{"Fabulous Desserts", "Textbooks", "$25.00"},
{"Folders", "School Supplies", "$1.00"},
{"Gift Cards", "Gifts", "$25.00"},
{"Highlighters", "School Supplies", "$2.00"},
{"Jacket", "Campus Gear", "$65.00"},
{"JAVA Programming", "Textbooks", "$150.00"},
{"Network Solutions", "Textbooks", "$75.00"},
{"Pencils", "School Supplies", "$1.00"},
{"Pens", "School Supplies", "$2.00"},
{"Shorts", "Campus Gear", "$10.00"},
{"Sweatshirts", "Campus Gear", "$40.00"},
{"T-shirts", "campus Gear", "$15.00"},
{"Web Design Ideas", "Textbooks", "$55.00"}};
System.out.println("Here is the list by Category Type.");
System.out.println("Please enter the category you are looking"
+ " for.");
String search = user_input.next();
System.out.println("Here is what we found for that category: ");
for (int row = 0; row < store.length; row++) {
for (int column = 0; column < store[row].length; column++)
if (store[row][column].toUpperCase().contains(search.toUpperCase()))
System.out.println(String.format("%20s\t", java.util.Arrays.toString(store[row])));