Question

How many ways are there to let the code output itself?

For example, write the code below,

public class Test
{
   public static void main(String[] args)
   {
      // some code
   }
}

to output itself

public class Test
{
   public static void main(String[] args)
   {
      // some code
   }
}

(Any programming language is accepted)

EDIT This question has been answered in the historical posts, search "quine" or check out https://stackoverflow.com/search?q=quine

Was it helpful?

OTHER TIPS

look up Quines.

You are wanting to read about quines. See here.

Hasn't this question already been asked?

There are an infinite number ways to do this. All you have to do is find one way and then add comments....

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top