Skip to content

Instantly share code, notes, and snippets.

@nicolasH
Created March 28, 2010 15:14
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 nicolasH/346798 to your computer and use it in GitHub Desktop.
Save nicolasH/346798 to your computer and use it in GitHub Desktop.
A Quine in java, created from the definition in Wikipedia.
/** @author Nicolas Hoibian */public class QuineJava_NicolasHoibian {public static void main(String[] args) {String src = "/** @author Nicolas Hoibian */public class QuineJava_NicolasHoibian {public static void main(String[] args) {String src = \"#\";src = src.replaceFirst(new String(new char[] { 35 }), src);System.out.println(src.replaceAll(new String(new char[] { 92, 34, 35, 92, 34 }), new String(new char[] { 92, 92, 34, 35, 92, 92, 34 })));}}";src = src.replaceFirst(new String(new char[] { 35 }), src);System.out.println(src.replaceAll(new String(new char[] { 92, 34, 35, 92, 34 }), new String(new char[] { 92, 92, 34, 35, 92, 92, 34 })));}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment