Quine: Difference between revisions

Content added Content deleted
(→‎{{header|Ada}}: Remove example which just copies the file Quine.adb standard output.)
(Remove Java example which just copies the file Quine.java to standard output.)
Line 29: Line 29:


Haskell does not keep the code in an uncompiled-equivalent form around at runtime, so the "quotation trick" has to be used.
Haskell does not keep the code in an uncompiled-equivalent form around at runtime, so the "quotation trick" has to be used.

=={{header|Java}}==
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class Quine{
public static void main(String[] args){
try{
BufferedReader input = new BufferedReader(
new FileReader("Quine.java"));
String line;
while((line = input.readLine())!=null){
System.out.println(line);
}
}catch(FileNotFoundException e){
e.printStackTrace();
}catch(IOException e){
e.printStackTrace();
}
}
}


=={{header|Perl}}==
=={{header|Perl}}==