Is there a way to execute a block of code in java without putting it in static main method
<p>If I want to just test a block of Java code, is there a way to run it without putting it in a function?</p>

<pre><code>Public static void main(String[] args){
//block of code
}
</code></pre>

<p>Also, how do I execute a static block of code like below?</p>

<pre><code>static {
//block of code
}
</code></pre>
