英文:
intellij println declaration
问题
I am trying to use the "sout" keyword in IntelliJ for calling system.out.println() quickly but it seems like doesn't work.
Looks like, I have some problems in settings sections.
Does anyone know the way the quick way problem
It Looks like this:
I solved the problem it was all about defining println() inside a method.
I solved it. The solution is that declaring the println() method within class or
inside another method as well.
class Main {
public static void main(String args[]) {
System.out.println(fun());
}
int fun()
{
return 20;
}
}
英文:
I am trying to use ''sout'' keyword in intellij for calling system.out.println() quickly but it seems like doesnt work.
Looks like, I have some problems in settings sections.
Does anyone know the way the quick way problem
It Looks like this:
I solved the problem it was all about defining println() inside a method.
I solved it. The solution is that declaring the println() method within class or
inside another method as well.
class Main {
public static void main(String args[]) {
System.out.println(fun());
}
int fun()
{
return 20;
}
}
答案1
得分: 2
只在任何方法内使用它,就像这样:
英文:
Yeah just use it inside in any method, like this:
答案2
得分: 1
>确保您处于此完成有意义的方法内,而不仅仅是在类内部。
英文:
According to Intellij support question
>Make sure you are inside the method where this completion makes sense, not just inside the class.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论