title: "The method main cannot be declared static; static methods can only be declared in a static or top level type"
body: <pre><code>class Perkusja {
    boolean talerze = true;
    boolean beben = true;
  
    void zagrajNaBebnie() {
      System.out.println("bam, bam, baaaa-am-am");
    }
    void zagrajNaTalerzach() {
      System.out.println("brzdęk, brzbrzrzdęęk");
    }
    class PerkusjaTester {
      public static void main(String[] args) {
          Perkusja p = new Perkusja();
      }
    }
  }
  </code></pre>
  
  <p>Hello! I'm new to stackoverflow so please forgive me my atrocious editing.</p>
  
  <p>I'm new to Java and i can't figure out where exactly the issue lies and what's the problem.
  I get the following error on the line
  <code>public static void main(String[]args)</code>:</p>
  
  <blockquote>
    <p>The method main cannot be declared static; static methods can only be declared in a static or top level type</p>
  </blockquote>
  
  <p>I'm using eclipse and i'm doing some simple java exercises. I googled the problem but the answers are usually related to much more complex pieces of code.</p>
  
  <p>How do i fix it and what's the cause of the following error? I'd be grateful for an explanation on this particular example.</p>
  
  <p>Cheers!</p>