Write a program that prints itself.
This is the same idea as my BASIC program. Half of the program is data echoing the other half.
public class selfprint { public static void main(string[] args) {
String[] data = new String[13];
char quote=34, endline=';';
String front = Character.toString('d')+'a'+'t'+'a'+'[';
String middle = Character.toString(']')+'='+quote;
String back = Character.toString(quote)+endline;
data[0]="public class selfprint { public static void main(string[] args) {";
data[1]="String[] data = new String[13];";
data[2]="char quote=34, endline=';';";
data[3]="String front = Character.toString('d')+'a'+'t'+'a'+'[';";
data[4]="String middle = Character.toString(']')+'='+quote;";
data[5]="String back = Character.toString(quote)+endline;";
data[6]="for (int i = 0; i<26; i++) {\";
data[7]=\"if (i<7) {\";
data[8]=\"System.out.println(data[i]);\";
data[9]=\"} else if (i>20) {";
data[10]="System.out.println(data[i-14]);";
data[11]="} else {";
data[12]="System.out.println(front+(i-7)+middle+data[i-7]+back);";
data[13]="} } } }";
for (int i = 0; i<28; i++) {
if (i<7) {
System.out.println(data[i]);
} else if (i>20) {
System.out.println(data[i-14]);
} else {
System.out.println(front+(i-7)+middle+data[i-7]+back);
} } } }