The regularity of these assessments has been fully considered in two other eases between the same parties, in respect to the tax assessed by these towns for the year 1866.* In those cases the question came up from the General Term of the Supreme Court, where it had been taken by certiorari, and the validity of the assessments sustained. The subject has been there examined in detail. If the assessments were a nullity, or void for the want of jurisdiction to impose them, it must be conceded that these actions were well brought. (Whitney v. Thomas, 23 N. Y., 281.) The lands in that case were assessed to William Merritt as the lands of a resident. The lands belonged in fact to Ogden, a non-resident; but they were not so assessed, and appeared on the assessment roll as the lands of a resident. The lands having been sold by the comptroller of the State, the nonresident owner brought ejectment and recovered them. The *98sale was held to be void. The comptroller was without any authority of law to make a sale for taxes of lands assessed on the roll to a resident owner, and his deed as well as the sale was void. The assessment was also held to be void in that case for another reason, affecting the jurisdiction of the assessors. The lands were not assessed according to the fact, either as the lands of a resident owner or of a non-resident. They were assessed to a third person, who had no ownership or possession, and no connection with them. It was not a mere error of the assessors, but a disregard of the facts of the case. They entered a false judgment, not warranted by any facts proven. It could not be called a mistake of law or fact, such as the assessors, acting as quasi judicial officers, might honestly make. It was simply an assessment, without the slightest color to warrant or authorize it. Assessors can have no jurisdiction to assess any of the lands in their town to third persons who do not own, possess or have any connection therewith. It was there said: “ If lands, belonging either to a resident or non-resident, could be assessed to a third person, having no connection with the premises, and be made the foundation of a sale and conveyance by the comptroller, great inconvenience and injustice might result. The true owner would be misled. He would have no notice of the assessment or of the proceedings upon it, and it would require extraordinary vigilance to discover and trace out such proceedings.” This case was much relied on by the respondent’s counsel, but it is not applicable here, unless the assessors were without jurisdiction. Jurisdiction is a subject which relates to the power of the court, and not to the right of the parties as between each other. (People v. Sturtevant, 9 N. Y., 269.) If the law confers the power to render a judgment, then the court has jurisdiction; what shall be adjudged between the parties, and with which is the right, is judicial action by hearing and determining it. (The State of Rhode Island v. The State of Massachusetts, 12 Peters, 718.)
When a court has jurisdiction, it has a right to decide every *99question which occurs in the cause; and whether its decision be correct or otherwise, its judgment is binding in every other court. But if it act without authority, its judgments are nullities. (Elliot v. Piersol, 1 Peters, 328, 340; Wilcox v. Jackson, 13 Peters, 511.)
When the statute prescribes the mode of acquiring jurisdiction, the mode pointed out must be complied with, or the proceeding will be a nullity. (Bloom v. Burdick, 1 Hill R., 130.)
Objections not relating to the jurisdiction of the officer cannot be raised collaterally. (Rusher v. Sherman, 28 Barb. R., 416; Stanton v. Ellis, 2 Kern., 575.)
These axioms are elementary.
■ The assessors of the towns of Hamburgh and Evans had jurisdiction to assess all the lands in their respective towns. It was made their duty, peremptorily, to do so. An error of judgment, as to the right or duty to impose the assessment on particular lands in the town, as to which an exemption is claimed, is not jurisdictional. (Barhyte v. Shepherd, 35 N. Y., 238.)
A flagrant disregard of the facts, or assessing in opposition to the clear and undisputed facts, where the application of the statute could not by any means be doubtful, might, as in the case of Whitney v. Thomas (supra), present a case where the officer would be without jurisdiction—assessing the lands of Ogden, a non-resident, as the lands of Merritt, a resident, who was neither an owner nor occupant, nor in any way connected with the land, appears to be such a flagrant disregard of the facts as to be a willful perversion of judgment, not to be regarded as an error, but as a judgment without jurisdiction. I think the Court of Appeals so regarded it. The application of the principle to the facts of each particular case is often attended with difficulty.
The assessors are quasi judicial officers, and the assessment roll, when finally completed by the supervisors of the county^ stands as a judgment. (Barhyte v. Shepherd, supra; Swift v. The City of Poughkeepsie, 37 N. Y., 511.)
*100The validity of a judgment which is not void, but only voidable, cannot be assailed collaterally. It can be attacked for fraud, or mistake as to the facts, only by a direct issue as to such facts. The case of Swift v. The City of Poughkeepsie (37 N. Y., 511), like the present one, was an action to recover for money had and received under an alleged illegal levy and collection of a tax. The court there said that “ a party cannot proceed a step in such an action, if, in order to sustain it, the court is called upon to review the merits or the regularity of the proceedings of determination, as the result of which the money was collected or paid over” (p. 514). It was also held that the proper remedy was by certiorari. The application of that remedy, in cases of- irregular or illegal assessments, has since been affirmed, in People v. The Board of Assessors of Brooklyn (39 N. Y., 81,) and People v. The Assessors of Albany, (40 N. Y., 155.)
The informalities of the affidavit of the assessors do not render the assessment void. The statute is substantially followed. (Parish v. Golden, 35 N. Y., 462.) The objection that the Superior Court of Buffalo had no jurisdiction of this action is not tenable.
Persons having causes of action against the county are authorized to commence their suits against the board of supervisors, and process shall be served on the chairman or clerk. (1 R. S., 901, §§ 1, 2, 3, 5th ed.)
The summons was served in this case on the clerk of the board, at the city of Buffalo. This is to be regarded as a personal service on the board. The statute gives that court jurisdiction in any case where the defendant is personally served with summons in that city. (Sess. Laws 1854, p. 225.)
The board represents the county as a municipal corporation, and Buffalo is the county seat, where the sessions of the supervisors are held. The clerk resides and was served in that city. I think the defendants have been so served as to be within the meaning of the statute above referred to in regard to the jurisdiction of that court. On the ground first men*101tioned the judgment should be reversed and a new trial ordered, with costs to abide the event.
Eael, 0.These are actions to recover money collected from the plaintiff, upon what is alleged to be a void assessment made in 1865 upon land of plaintiff, situated in the town of Hamburgh, Erie county. The principal allegation of error in the assessment is that the land was assessed in personam as the land of a resident of that town, and not as nonresident land. I believe the assessment was correctly made. The statute (1 R. S., 388, § 1, Edmonds’ ed.) provides, that all lands within the State owned by individuals or by corporations shall be liable to taxation; and hence this land was liable to taxation somewhere. It is further provided (2 R. S., 389, § 1) that every person shall be assessed in the town or ward where he resides, when the assessment is made, for all lands then owned by him within such town or ward, and occupied by him or wholly unoccupied. Section 2 provides that land occupied by a person other than the owner may be assessed to the owner or occupant, or as non-resident land. This section undoubtedly means that when the owner and occupant both reside in the town where the land is situated, the land may be assessed to either. When the owner does not reside in the town and the occupant does, it must be assessed to the occupant; and when neither of them resides in the town it must be assessed as non-resident land. By no other construction can I see how occupied land can be assessed as non-resident land as the statute as to the taxation of non-resident land provides that land occupied by a resident of the town shall not be taxed as non-resident. (1 R. S., 392, § 13.) Section 3 provides that unoccupied land not owned by a resident of the town shall be assessed as non-resident land, and section 9 provides that the assessors shall prepare an assessment roll and insert therein the names of the “ taxable inhabitants ” of the town. Taking all these provisions of the statute together, it seems to me quite plain that there is no authority *102for placing upon the assessment roll for a tax in personam the name of any person not an inhabitant of the town.
Section 6 provides that “ the real estate of all incorporated companies liable to taxation shall be assessed in the town or ward in which the same shall lie in the same manner as the real estate of individualsand hence it is claimed that unless the plaintiff can be regarded, in some legal sense, as a resident of the town of Hamburgh at the time of the assessment in 1865, there was no authority to insert its name in the assessment roll.
While corporations are artificial, intangible, invisible beings, yet, in law, they are treated sometimes as persons, occupants, inhabitants, citizens. They exist by force of law, and can have an existence only within the jurisdiction in which they are created. Under the act of congress of 1789, commonly called the judiciary act, jurisdiction was conferred upon the circuit courts of suits between a citizen of the State where the suit is brought and a citizen of another State. The Supreme Court of the United States has held that, within this act, a corporation was a citizen of the State where it was created. (Ohio and Mississippi Railroad Co. v. Wheeler, 1 Black, 286.) By statute (22 Hen., 8, C. 5), concerning bridges and highways, it was enacted that bridges and highways shall be made and repaired by “ the inhabitants of the city, shire or riding,” and that the justices shall have the power to tax every “ inhabitant of such city,” etc., and that the collectors may “ distrain every such inhabitant as shall be taxed and refuse payment,” etc. Lord Coke (2 Inst., 703) says: “ Every corporation and body politic residing in any county, riding, city or town corporate, or having lands or tenements in any shire quae propriis mamibus et sumptibus possident et habent, are said to be inhabitants there, within the purview of this statute.” In Rex v. Gardner (Cowper, 79), the Court of King’s Bench decided that a corporation came within the description of “ occupiers or inhabitants ” for the purpose of taxation, under a statute passed in the reign of Elizabeth.
*103It has been many times held by the courts that, under section 125 of the Code, requiring “ actions to be tried in the county in which the parties, or any of them, shall reside at the commencement of the action,” a railroad corporation is a resident of every county through which its road passes; and it has been held that such a corporation is so far a resident of every county through which its road passes that it cannot be sued in Justices’ Courts by short summons. (Belden v. New York and Harlem R. R. Co., 15 How., 17; Sherwood v. Saratoga and Wash. R. R. Co., 15 Barb., 650.) In the latter case Mr. Justice Willard says: “A railroad company must be treated as an inhabitant and freeholder in each county where its track is laid.” In Glorie v. S. C. Railroad Co. (1 Strobhart, 70), it is said that the residence of a company is most obviously where it is actively present in the operations of its enterprise. It will thus be seen that while corporations, in their general aspect, are mere ideal existences, without body or soul, yet they will be considered inhabitants, residents, citizens, when the general spirit and purpose of the law require it.
This corporation was created by the laws of this State to construct and operate a railroad through a portion of the State, and for that purpose was authorized to take and hold real estate along the line of its road. It was, therefore, a citizen, inhabitant and resident of this State, and either resided everywhere in the State, or at some place or places within it. To what particular locality in the State was its residence confined ? Its residence might have been confined to a particular locality by some provision in its charter; but we are not informed that there was any such provision. It is claimed, however, by the plaintiff, that its residence was fixed in Buffalo, the place of its principal office, by the statute (1 R. S., 362, § 6), which provides that “ all the personal estate of every incorporated company, liable to taxation on its capital, shall be assessed in the town or ward where the principal office or place for transacting the financial concerns of the company shall be; or if such company have no principal office or place *104for transacting its financial concerns, then in the town or ward where the operations of said company shall be carried on.” This statute does not fix or intend to fix the residence of the corporation, but provides simply for the taxation of its personal estate. What, then, determines the location or residence of a corporation within this State ? The provisions of its charter may do so. In the absence of such provisions, its nature, character and mode of operation must determine-this. A municipal corporation is confined to its territorial limits. Other corporations are organized to transact business in a particular town or city, and are thus located there, and a railroad which passes through several counties, and occupies lands in several counties for the carrying on of its corporate business, must, at least for the purpose of taxation, be regarded as a resident of each town and county through which it passes. Were it not for the statute above cited, its personal property would be taxed in the same way wherever it was found, not in transit, but for use in its corporate business; and to avoid confusion and uncertainty, and that all its taxable personal property might be reached, the above statute was passed. A corporation, for many purposes, lives, moves and has its being in its agents, and wherever they are in possession of its real estate, carrying on its corporate business, it may be supposed to exist and reside, without departing from legal precedents or violating the spirit or letter of the law.
Hence, I reach the conclusion that the land of the plaintiff, situated in the town of Hamburgh, was properly assessed and taxed as resident land, and this conclusion is fortified and sustained by considerable authority (Mohawk and Hudson Railroad Co. v. Clute, 4 Paige, 384; The Albany and Schenectady Railroad Co. v. Osborn, 12 Barb., 223; The People v. The Supervisors of Niagara, 4 Hill, 20, 25; The People v. Fredericks, 48 Barb., 173; The People v. Beardsley, 52 Barb., 105, affirmed in the Court of Appeals September, 1869 ; The People v. Cassity, 2 Lansing, 294), and is in conformity with the general and almost, if not quite, uniform practice throughout the State.
*105But there is another answer to this action, as to which I am equally confident.
It is now settled that assessors, in making assessments in all cases where they have jurisdiction, act judicially. (Swift v. City of Poughkeepsie, 37 N. Y., 511; Barhyte v. Shepherd, 35 N. Y., 238.) This land was situated in the town of Ham-burgh, and, hence, the assessors of that town had jurisdiction to assess it. In exercising this jurisdiction, they were to decide not only all questions of fact involved, but also all questions of law. Among other things, they were to determine whether this land was to be assessed as resident or nonresident land, and that was a question of both law and fact. They were to determine the facts, and then whether these facts made it non-resident land. The question of law seems not to be a plain one, as the Supreme Court in the eighth district has decided it one way and the Superior Court of Buffalo the other way. In such a case, it cannot be that the assessors are to determine at their peril. On the contrary, I have no doubt that whichever way they decide they have the immunity of judicial officers; and as they will be protected, all persons who act upon their assessment in enforcing the tax will have equal protection; and the tax, after it has once reached the treasury of the county, can no more be collected back than if it had been placed there as the proceeds of a judgment of a regular court. It seems to me that this is the logical result of the decisions last above cited. Hence, the plaintiff, if it felt aggrieved by the action of the assessors in making this assessment, should have sought a review by certiorari, or in some other mode; and they cannot attack the decision of the assessors, collaterally, and treat it as void, as it must be treated in order to sustain a recovery in this action.
It is also claimed that the assessment was void on account of the defect in the affidavit attached to the roll by the assessors. In Van Rensselaer v. Witbeck (7 N. Y., 517), the affidavit of the assessors was held to be so defective as to render the assessment void and the collection of the tax *106illegal. But that was a case where no presumptions could be indulged. The affidavit showed that the property had not been assessed according to law. In Parish v. Golden (35 N. Y., 462), the affidavit of the assessors was not a literal compliance with the statute, and yet the assessment was held valid. The court decided that it was sufficient if the affidavit was a substantial compliance with the statute, and it was the opinion of the judge who wrote the opinion of the court, that unless the affidavit showed affirmatively that the assessors did not comply with the statute in making the assessment of property, it would be presumed that they had complied, and the assessment would be held valid. Without going so far in this case, we may hold that the affidavit, in every important particular, was a substantial compliance with the statute, and hence that the tax was not illegal on account of any informality in the affidavit.
The affidavit of the assessors was properly sworn to before a notary public under chapter 508 of the Laws of 1863.
I am, therefore, of the opinion that the assessment and tax in this case were not void, and that the plaintiff cannot maintain this action.
The judgment of the Special and General Terms should be reversed and new trial granted, costs to abide event.
All concur.
Judgment reversed.