打印java文件自己

来源:互联网 发布:小班美工区域观察记录 编辑:程序博客网 时间:2024/06/08 07:12
package com.langsin.ceshi;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]);    }}