")</syntaxhighlight>=== Inform7 ===== J ===== J ====== Java ===In console:<syntaxhighlight lang="java">public class HelloWorld {</syntaxhighlight>or in window with Swing:<syntaxhighlight lang="java">import javax.swing.JFrame; // Importing class JFrameimport javax.swing.JLabel; // Importing class JLabelpublic class HelloWorld {</syntaxhighlight>Or in Applet:<syntaxhighlight lang="java">import java.awt.
")</syntaxhighlight>=== جاوا ===<syntaxhighlight lang="java">public class HelloWorld {</syntaxhighlight>To write to an HTML document:<syntaxhighlight lang="javascript">document.write('Hello, world!