Created
April 26, 2017 21:01
-
-
Save Acarus/1a13af1ff0f621c2093c2ae4483c5b22 to your computer and use it in GitHub Desktop.
This file contains 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
public class Quine | |
{ | |
public static void main(String[] args) | |
{ | |
char q = 34; // Quotation mark character | |
String[] l = { // Array of source code | |
"public class Quine", | |
"{", | |
" public static void main(String[] args)", | |
" {", | |
" char q = 34; // Quotation mark character", | |
" String[] l = { // Array of source code", | |
" ", | |
" };", | |
" for(int i = 0; i < 6; i++) // Print opening code", | |
" System.out.println(l[i]);", | |
" for(int i = 0; i < l.length; i++) // Print string array", | |
" System.out.println(l[6] + q + l[i] + q + ',');", | |
" for(int i = 7; i < l.length; i++) // Print this code", | |
" System.out.println(l[i]);", | |
" }", | |
"}", | |
}; | |
for(int i = 0; i < 6; i++) // Print opening code | |
System.out.println(l[i]); | |
for(int i = 0; i < l.length; i++) // Print string array | |
System.out.println(l[6] + q + l[i] + q + ','); | |
for(int i = 7; i < l.length; i++) // Print this code | |
System.out.println(l[i]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment