intellij println声明

huangapple go评论76阅读模式
英文:

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.

intellij println声明

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.

intellij println声明

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

只在任何方法内使用它,就像这样:

intellij println声明

英文:

Yeah just use it inside in any method, like this:

intellij println声明

答案2

得分: 1

根据Intellij支持问题

>确保您处于此完成有意义的方法内,而不仅仅是在类内部。

英文:

According to Intellij support question

>Make sure you are inside the method where this completion makes sense, not just inside the class.

huangapple
  • 本文由 发表于 2020年8月11日 04:49:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/63347840.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定