Java Applet Commented Applet Tag
<p>I am new to applets and came across something unusual. In one of the programs I went through, <code>applet html tag</code> is mentioned as a comment in the <code>Applet Java file (.java)</code> but the comment seems to be getting executed. How is this possible? </p>

<p>Code:</p>

<pre><code>    import java.awt.*;

    import java.applet.*;

/*&lt;applet code="MyApplet" width=100 height=50&gt;&lt;/applet&gt; */ 

   //why we give comment here and how it is executed ?? 

     class MyApplet extends  Applet 
    {
    public void paint(Graphics g)
    {
    g.drawString("A Simple Applet",100,100);

     }
  }
</code></pre>

<p>Comment:
<code>/*&lt;applet code="MyApplet"   width=100 height=50&gt;&lt;/applet&gt; */ </code></p>

<blockquote>
  <p>How is the above comment getting executed? Aren't comments meant to be skipped?</p>
</blockquote>

<p>Why is this method not mentioned on Oracle or any other websites? 
Even Oracle asks to create seperate HTML file. So does this method use some 3rd party library to execute the comment?</p>

<p>I am also getting an error when I don't make the class public and when I keep the file and class name different.</p>

<p>Can someone please explain this method? I googled a lot but an explanation for this method of including the tags in a comment is nowhere to be found. There is a post on SO but the answer is not up to the point. Please Help.</p>

<p>How could someone accidentally figure out that this is possible? Is this any particular feature of the Applet Class?</p>