prism/examples/prism-birb.html

31 lines
670 B
HTML

<h2>Comments</h2>
<pre><code>// Single line comment
/* Block comment
on multiple lines */</code></pre>
<h2>Annotations</h2>
<pre><code>&lt;Supersede&gt; // marks an instance member as overriding a superclass</code></pre>
<h2>Numbers</h2>
<pre><code>int x = 1;
double y = 1.1;
</code></pre>
<h2>Strings</h2>
<pre><code>String s1 = 'Strings allow single quotes';
String s2 = "as well as double quotes";
var s2 = 'Birb strings are
multiline by default';</code></pre>
<h2>Full example</h2>
<pre><code>class Birb {
final String name;
int age = 19;
void construct(String newName){
nest.name = newName;
}
}
Birb.construct('Yoko');
screm(Birb.name);
</code></pre>