Is there heredoc alternative in Java (heredoc as PHP)? [duplicate]
This question already has an answer here: Java multiline string 39 answers For JAVA development I need writing to a files with strings like "\r\t\n <>", because from Java I want writing a PHP file. If you can't understand look at this example: BufferedWriter buffW = new BufferedWriter(fileW); buffW.write("<?php\n\n\tclass MyClass {\n\tpublic function test()\n}\n}\n?>"); This is mess a code, I want to write a clean such as PHP can do, but can't find on Java alternative way as example: <?php $mystring = <<<EOT This is some PHP text. It is completely free I can use "double quotes" and 'single