The document.write is a method of a class that belongs this and outputs a string directly into page. This method is some use nowadays and used as appending to document
How document.write works:
When document is loading, a script may document.write(text) into the document. The text will be rendered same way as if it were in HTML.
I have mentioned some codes of example:
1. <Script>// Starting of java
2. Document .write(‘ First java program!’) // method to output on screen