Letton, J.
The relator is a railroad corporation owning and operating a line of railroad in Nebraska through the village of Emmett, in Holt county. The respondent is judge of the district court for Holt county. On the 31st day of December, 1906, the respondent, as such judge, issued a peremptory writ of mandamus to the railroad company on the application of one Wilson, commanding it immediately to furnish Wilson three cars in which to load and ship thirty tons of hay from Emmett to Lincoln, Nebraska, and also rendered judgment against the relator for $6.85, costs incurred. No alternative writ was issued and served upon the company, nor was any order to show cause issued and served, but on December 29 a notice was served by Wilson upon the agent of the railroad company at O’Neill, substantially to the effect that he would apply to the district court for Holt county, Nebraska, at 10 o’clock in the forenoon, on the 31st day of December, 1906, for a peremptory writ of mandamus compelling it to furnish him immediately seven cars in which to ship hay from Emmett, Nebraska, to Lincoln, Nebraska. The relator contends that the order allowing the writ was made without power or jurisdiction, and prays for a writ to compel the respondent to set aside the order awarding the same, and the judgment for costs. The relator in its application sets up a good and sufficient defense to the mandamus proceedings *397in Holt county, and further alleges that it has furnished at Emmett, to all shippers without discrimination, all the ears it was able to supply. The respondent, in answer to i he alternative writ, sets forth the notice and application of Wilson and the default of the railroad company to appear at the time and place specified in the notice, and alleges that a hearing was then and there had and judgment entered, and that the court had jurisdiction to award the peremptory writ applied for; that Wilson made a case authorizing the granting of a peremptory writ without first issuing an alternative writ, and that the court determined the existence of such right, and its judgment is not subject to collateral attack. To this answer the relator lias filed a general demurrer, and the cause is submitted upon the question whether the allegations of the answer are sufficient to constitute a defense.
1. The relator contends that under the rule in Horton v. State, 60 Neb. 701, the district court for Holt county had no power or authority to issue a peremptory writ of mandamus against the relator without the issuance of an alternative writ. In the Horton case it Avas held that the statute authorizing the issuance of a peremptory Avrit of mandamus Avithout notice has reference to cases in Avhich the refusal of a public officer to discharge official duty is so obviously inexcusable, and the necessity for prompt action so imperative, that notice must be dispensed Avitli in order to prevent a failure of justice, and that no such power can be exerted against a private corporation or its officers by which its functions are performed, since no person can be deprived of property or valuable rights without notice and opportunity for a hearing. The case was in effect an action to compel a private corporation to pay a debt, and it is clear that such a proceeding was beyond the proper purpose of the writ of mandamus. The relator in this case, hoAveve-r, is a public corporation. Extensive poAvers and rights have been conferred upon it by the state in return for its assumption of the obligation to serve the public. We Ihink that there may perhaps be a dis*398tinction between the power of a court to compel the action of a public service corporation in a proper case by peremptory writ without notice and the power to exert the same authority over a private corporation in a matter in which the public has no concern. We think it unnecessary to determine in this action whether a peremptory writ may not be issued against a public corporation without notice if an emergency should arise apparently warranting such an unusual and drastic procedure.
2. If the district court for Holt county acquired jurisdiction over the defendant in the mandamus proceedings, the answer of the respondent is a complete defense, sinc'e its judgment cannot be attacked collaterally or reviewed in such a proceeding as this. It appears that on the 29th day of December, the date upon which the notice was served by Wilson, no application had been made to that court for a writ of mandamus, and no such application was filed until on the 31st day of December, two days after service of the notice, and that the writ was issued immediately. It was impossible, therefore, for the railroad company to ascertain until the time of hearing whether or not the notice was served in good faith and whether in fact any application would ever be made to the district court for the issuance of a writ. It rested in the bosom of Wilson as to whether or not he would ever make such application. In its application in this court the relator alleges that a number of such notices have been served upon it by various parties at the village of Emmett, and that, when it appeared at the time and place specified in order to show cause, no application was in fact made to the court. This allegation is denied by the answer and, hence, cannot be taken as admitted, and yet it is a fair example of what in fact might happen if a practice of this kind can be tolerated. It is argued by counsel for the respondent' that a summons is not necessary in a mandamus case, and that if the defendant received actual notice of the application it will be sufficient. He concedes, however, that notice in some form must be given in such a case as this. 'With*399out determining the proper manner and form of such notice, or whether or not a notice of the form served by Wilson would be sufficient to confer jurisdiction if served after proceedings were actually begun, we think it clear that, until proceedings had actually been begun by the filing in court of an application for the writ, a notice that at some future time the relator would apply therefor has no substantial basis and is of no effect whatever as a step in a legal proceeding; that, since it rested on the mere whim of the relator therein as to whether or not a proceeding would ever be begun, the railway company was entitled to entirely disregard the same, and that such a notice served at such a time was insufficient to confer jurisdiction upon the district court and was a mere private paper. Section 648 of the code provides: “When the right to require the performance of the act is clear, and it is apparent that no valid excuse can be given for not performing it, a peremptory mandamus may be allowed in the first instance. In all other cases, the alternative writ must first be issued.” , Section 649 provides: “The motion for the writ must be made upon affidavit, and the court may require a notice of the application to be given to the adverse party, or may grant an order to show cause why it should not be allowed, or may grant the writ without notice.” Under these provisions an alternative writ, and not a peremptory writ, should be issued in the first case, or, if a peremptory writ is applied for, a notice to show cause why it should not issue should be given and a hearing had before its issuance. It is only where there is no room for controversy as to the right, and where from the nature of the facts set forth in the affidavit the court can take judicial knowledge that a valid excuse is impossible, that a writ may issue without notice. In Home Ins. Co. v. Scheffer, 12 Minn. 261, it is said: “The questions to be decided in order to determine whether the right is clear, and whether no valid excuse can be given, are: First, is this showing true? and, second, does the tribunal applied to know it to he true, on account of the nature of the *400facts shewn or from the admissions of the defendant?” The facts set forth in Wilson’s application Avere of such a nature as to admit of controversy, and the railroad company might Avell have, and in tlds application alleges that it did have, a valid and sufficient defense thereto. In such it case a court has no power or jurisdiction to issue a peremptory writ without, first, the filing of the application in the court; and, second, notice being given thereafter of the pendency of the same and of the time and place Avhere the application will he heard. It was impossible for the district court to have knowledge that no valid excuse could be given for the railroad company not furnishing cars, and it had, therefore, no power to issue a peremptory writ without the defendant having been notified of the pending proceedings. As Ave have seen, the notice actually served Avas without legal foundation, and the Avrit issued was A'oid.
The demurrer to the ansAver is therefore sustained, and the writ of mandamus allowed.
Writ alloaved.