Execute HQ9+/Java: Difference between revisions

m
Fixed syntax highlighting.
m (Spaces so "break" is highlighted)
m (Fixed syntax highlighting.)
 
(3 intermediate revisions by 3 users not shown)
Line 1:
{{implementation|HQ9+}}{{collection|RCHQ9+}}[[Category:Java]]This program accepts input from a file named by its first argument, or std in if no arguments are given.
This [[Java]] program accepts input from a file named by its first argument, or std in if no arguments are given.
<lang java>import java.io.BufferedReader;
 
Note: A [[Unicode]] trick could be done to make this source code a quine (similar to the one done in [[RCHQ9+/Tcl]], but also replacing the literal 99's with "100 - 1").
<langsyntaxhighlight lang="java">import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
Line 44 ⟶ 47:
"1#One bottle|2#{0} bottles} of beer", n);
}
}</langsyntaxhighlight>
9,476

edits