Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当从菜单中选择元素并且它们相应的查询字符串的参数必须更改以显示信息时,我将构建一个应用程序:
查询字符串示例:“?inst=8&group=4420&semestr=1&semest_part=2”。你能告诉我怎么做吗?
利用String.format
String.format
int inst = 8; int group = 4420; int semestr = 1; int semestr_part = 2; String query = String.format("?inst=%d&group=%d&semestr=%d&semest_part=%d", inst, group, semestr, semestr_part);