Last active
May 13, 2017 14:08
-
-
Save chrisbay/6d41e1e698877b1acf1f96b80076be4d to your computer and use it in GitHub Desktop.
A (cheating) quine in Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
public class Quine{ | |
public static void main(String[] args) throws IOException { | |
try(BufferedReader br = new BufferedReader(new FileReader("Quine.java"))) { | |
StringBuilder sb = new StringBuilder(); | |
String line; | |
while ((line = br.readLine()) != null) { | |
sb.append(line).append(System.lineSeparator()); | |
} | |
System.out.print(sb.toString()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment