Copy stdin to stdout: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 449: | Line 449: | ||
} |
} |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
Alternative, concise version (Java 9+): |
|||
<syntaxhighlight lang="java"> |
|||
public class CopyStdinToStdout { |
|||
public static void main(String[] args) throws java.io.IOException { |
|||
System.in.transferTo(System.out); |
|||
} |
|||
} |
|||
</syntaxhighlight> |
|||
{{out}} |
{{out}} |
||
Output interleaved. Stdin and Stdout are same window. |
Output interleaved. Stdin and Stdout are same window. |