Skip to content

Instantly share code, notes, and snippets.

@octylFractal
Created August 22, 2016 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save octylFractal/707d294e2862f23acf4d3968060c744b to your computer and use it in GitHub Desktop.
Save octylFractal/707d294e2862f23acf4d3968060c744b to your computer and use it in GitHub Desktop.
package me.kenzierocks.test;
public class Quine {
static String data = "CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCJwYWNrYWdlIG1lLmtlbnppZXJvY2tzLnRlc3Q7Iik7CiAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCIiKTsKICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oInB1YmxpYyBjbGFzcyBRdWluZSB7Iik7CiAgICAgICAgU3lzdGVtLmVyci5wcmludGxuKCIiKTsKICAgICAgICBTeXN0ZW0uZXJyLnByaW50bG4oIiAgICBzdGF0aWMgU3RyaW5nIGRhdGEgPSBcIiIgKyBkYXRhICsgIlwiOyIpOwogICAgICAgIFN5c3RlbS5lcnIucHJpbnRsbihuZXcgU3RyaW5nKGphdmEudXRpbC5CYXNlNjQuZ2V0RGVjb2RlcigpLmRlY29kZShkYXRhKSwgamF2YS5uaW8uY2hhcnNldC5TdGFuZGFyZENoYXJzZXRzLlVURl84KSk7CiAgICB9Cgp9";
public static void main(String[] args) {
System.err.println("package me.kenzierocks.test;");
System.err.println("");
System.err.println("public class Quine {");
System.err.println("");
System.err.println(" static String data = \"" + data + "\";");
System.err.println(new String(java.util.Base64.getDecoder().decode(data), java.nio.charset.StandardCharsets.UTF_8));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment