java 如何在 IntelliJ 中获取方法调用的返回类型?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13462470/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 12:50:07  来源:igfitidea点击:

How to get the return type of a method call in IntelliJ?

javaintellij-ideareturn-type

提问by loyalflow

Normally you would expect just hovering over a method it would show a popup of the return type.

通常你会期望将鼠标悬停在一个方法上,它会显示一个返回类型的弹出窗口。

How do you get this information in intellij ultimate?

你如何在intellij Ultimate中获得这些信息?

回答by ScottShamus

You hover it and hold down CTRL in windows or CMD in Mac

您将其悬停并在 Windows 中按住 CTRL 或在 Mac 中按住 CMD

回答by Tomasz Nurkiewicz

Hit Ctrl+ Q(or ?Jon Mac) when cursor is on a method declaration or call. It will show you the pop-up you want. As a bonus: Ctrl+ Shift+ Iwill display method body as well in a pop-up.

当光标位于方法声明或调用上时,点击Ctrl+ Q(或?J在 Mac 上)。它会显示您想要的弹出窗口。作为奖金:Ctrl+ Shift+I将在弹出显示方法体为好。

回答by Denys Titarenko

Try Ctrl+ Spacefor quick definition
Also Ctrl+ Shift+ Pmay help

尝试Ctrl+Space快速定义
Ctrl+ Shift+ P5的帮助

回答by Rancho

In intellij, Go to Help > Productivity Guide you will find a list of useful shortcuts to increase productivity

在 Intellij 中,转到“帮助”>“生产力指南”,您将找到提高生产力的有用快捷方式列表

Regarding, this question in mac Press option+command+V to get the list of names that you can choose enter image description here

关于,mac 中的这个问题按 option+command+V 以获取您可以选择的名称列表 在此处输入图片说明

Ctrl+ J in mac for getting the documentation

mac 中的 Ctrl+J 获取文档

Find screenshots for ease:-

轻松查找屏幕截图:-

回答by Богдан Валовый

Hot key for that: Ctrl + Shift + P Toolbar: "View->Type Info"

热键:Ctrl + Shift + P 工具栏:“视图-> 类型信息”