如果它们相同的类型,如何更改论点的顺序?

发布于 2025-02-03 20:51:28 字数 295 浏览 2 评论 0原文

如果VSCODE中的类型相同,如何更改参数顺序?

我正在写爪哇,现在我只是一个大问题

:我有一种方法

void employee(int age, int id) {
    ...
}

:有一天,我认为如果ID在年龄的前面,那会更好:

void employee(int id, int age) {
    ...
}

不幸的是,当我意识到这一点时,我已经使用了它是数百甚至一千次,Vscode是否有更改顺序的支持?

How to change the order of argument if they're same type in vscode?

I'm writing java, and I just have a big problem right now

example: I have a method

void employee(int age, int id) {
    ...
}

But one day, I thought that it's better if the id is in front of age:

void employee(int id, int age) {
    ...
}

Unfortunately, when I realized that, I had already use it hundred or even thousand time, do vscode have support with change order of it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青萝楚歌 2025-02-10 20:51:28

您可以尝试使用功能过载。

void employee(int age, int id) {
    ...
}
void newEmployee(int id, int age) {
    employee(age,id);
}

You can try to use function overloading.

void employee(int age, int id) {
    ...
}
void newEmployee(int id, int age) {
    employee(age,id);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文