If the defendant named in such writ or information fail to appear after the service thereof as aforesaid, the court may hear proof of the allegations of the petition or information, and if such allegations be sustained, the court shall give judgment accordingly. But if the service be made by publication, the defendant against whom such judgment is rendered, upon giving bond and security as provided in section three of this article, may, at the next term of the court or within such additional time as the court may allow, on petition filed for the purpose, have the judgment against him set aside, and make such defense as he or it may have thereto. If the defendant appear before the end of the term next after the service of the writ or summons, or thereafter before judgment is rendered against him he may demur or plead not guilty, or both, to such writ, or demur or answer in writing, or both, to such information, and every allegation contained in such information which is not denied by such answer shall be taken as true and no proof thereof shall be required.