
44 Cal.2d 574 (1955)
HENRY MILLER BOWLES et al., Petitioners,
v.
THE SUPERIOR COURT OF THE CITY AND COUNTY OF SAN FRANCISCO et al., Respondents; GEORGE W. NICKEL, JR., et al., Real Parties in Interest. [S. F. No. 19123.
S. F. No. 19122. 
Supreme Court of California. In Bank.  
May 19, 1955.
 John Francis Neylan and John F. Duff for Petitioners in S. F. No. 19122. Reginald L. Vaughan, Varnum Paul and Vaughan, Paul & Lyons for Petitioners in S. F. No. 19123.  Morse Erskine for Respondents.
 C. Ray Robinson, T. Keister Greer, William B. Boone, Earl F. Hedlund and Herman F. Selvin for Real Parties in Interest.
 GIBSON, C.J.
 Some of the beneficiaries of a trust established by Henry Miller brought a suit for removal of the trustees and for additional relief. Respondent court appointed a receiver, accepted the resignations of two trustees, removed the third trustee and appointed successor trustees. This proceeding was then commenced by other beneficiaries to prohibit further steps from being taken in that action and to have the orders already made declared null and void.
 Under the terms of the trust, the income was payable for *578 life to Henry Miller and then for life to his daughter and son-in-law, Nellie Miller Nickel and J. Leroy Nickel. After their deaths the income became payable to their three children George W. Nickel, J. Leroy Nickel, Jr., and Beatrice Nickel Morse, who are life beneficiaries. Upon the death of a life beneficiary his share of the income is to be paid to his issue, and upon the death of the last surviving life beneficiary the trust is to terminate and the corpus, with certain exceptions, is to be distributed to the "descendents born in lawful wedlock" of Nellie Miller Nickel and her husband, J. Leroy Nickel. To differentiate between the classes of beneficiaries, we shall use the terms "life beneficiaries" and "remaindermen." Life beneficiary George W. Nickel had four children, hereafter called the Nickel remaindermen, and fifteen grandchildren. Beatrice Nickel Morse had three children, hereafter called the Bowles remaindermen, and six grandchildren. J. Leroy Nickel, Jr., had no children.
 . The trustees were J. Leroy Nickel, Jr., one of the life beneficiaries, J. E. Woolley and A. R. Olsen.
 The trustee removal action was brought by three of the Nickel remaindermen, George W. Nickel, Jr., Mary Nickel Lombardi and John Beverly Nickel. Sally Nickel Mein later joined the other Nickel remaindermen as a party plaintiff. The present proceedings were commenced by two of the life *579 beneficiaries, George W. Nickel and Beatrice Nickel Morse, and by the Bowles remaindermen, Henry Miller Bowles, George McNear Bowles and Amy Bowles Lawrence.
 The complaint in the removal action was filed on June 13, 1954, by the Nickel remaindermen "as beneficiaries of the trust ... who sue in their own behalf, and in behalf of all other persons who have a beneficial interest in said trust." They alleged that defendant trustees were guilty of fraud and mismanagement, that the trust, as well as certain corporations in which the trust owned most of the stock, had been defrauded by the acts of C. E. Houchin and others, that the trustees had failed and refused to present claims against the estate of Houchin following his death or to take steps to recover trust and corporate properties, and that claims against the Houchin estate would be barred by the statute of limitations unless presented by June 16.  [fn. 2] The complaint prayed for the appointment of a receiver with authority to file such claims, for the removal of defendant trustees and the appointment of new trustees, for an accounting by the trustees and an order surcharging them in the amounts found due from them to the trust, and for an order directing J. Leroy Nickel, Jr., to return to the trust all income which he had received as a life tenant. While the present proceedings were pending, the Nickel remaindermen amended their complaint by deleting the portion of the prayer which requested that an accounting be had, that the old trustees be surcharged in the amounts due from them and that J. Leroy Nickel, Jr., return to the trust all income received by him as life beneficiary.
 On June 13 the superior court issued an ex parte order appointing M. Mitchell Bourquin as receiver with authority to file claims on behalf of the trust, and the trustees were ordered to show cause why they should not be removed and new trustees appointed. On June 15, the return day, J. Leroy Nickel, Jr., and A. R. Olsen resigned as trustees. The third trustee, J. E. Woolley, was removed by the court on the ground that there was a conflict in interest, since he was *580 a trustee of a trust declared in Houchin's will and attorney for Houchin's executor. The receiver was appointed as temporary trustee, and the hearing on the appointment of successor trustees was then continued to June 30.
 When the hearing was resumed the petitioning life beneficiaries and the Bowles remaindermen presented complaints in intervention and requested leave to file them.  [fn. 3] The court informed petitioners that their applications to intervene would be acted upon at a later date. The Bowles remaindermen then requested the court to appoint Henry Miller Bowles as trustee. The petitioning life beneficiaries suggested the appointment of a corporate trustee and two unbiased individuals, and they offered the names of several banks and a number of persons. J. Leroy Nickel, Jr., concurred in these suggestions. The court stated that the appointments would be made "today," that no one having a direct interest in the trust would be selected and that three completely disinterested persons would be appointed. The court asked if any other counsel wished to be heard and, upon receiving no response, appointed M. Mitchell Bourquin, Louis Ferrari and Jesse H. Steinhart as trustees. None of these persons was among those suggested by petitioners.
 The court-appointed trustees assumed administration of the trust and, as holders of the stock of Miller & Lux Incorporated, participated in stockholders' meetings at which changes were made in the board of directors. On authorization of the directors, a contract was entered into with C. Ray Robinson, who was counsel for the Nickel remaindermen, employing him as attorney for the corporation in the investigation and prosecution of claims against the persons *581 who were named in the trustee removal action as having defrauded the trust.
 Pursuant to directions from the court to report at the earliest possible moment on the status of the administration of the trust, the trustees filed a report on July 30, and a hearing was had on August 2. The life beneficiaries and the Bowles remaindermen were present. A second complaint in intervention was offered by the Bowles remaindermen, and they made a motion that they be joined as necessary and indispensable parties.  [fn. 4] The court stated that it would not entertain a petition or ex parte motion at that time, that the previous applications to intervene had been denied and that any subsequent motion for leave to intervene should come up "regularly, on notice and not ex parte." The report of the trustees was approved.
 The present proceedings were thereafter commenced, and the District Court of Appeal issued alternative writs of prohibition, followed later by a peremptory writ. A hearing in this court was then granted.
 Claims were filed by the receiver against the Houchin estate on June 15, and thereafter a suit based on them was commenced by Miller & Lux Incorporated in the United States District Court. Subsequently, Miller & Lux Incorporated, the new trustees and the Nickel remaindermen entered into an agreement not to sue the Houchin estate or the Houchin executors, who agreed in return that Miller & Lux Incorporated should receive more than two million dollars in cash together with property having a value of several million dollars.
 We are confronted at the outset with the question of whether petitioners may use the writ of prohibition to determine if the trial court exceeded its jurisdiction in refusing to permit them to intervene as formal, named parties in the action. [1] The writ, of course, is not available where there is a plain, speedy and adequate remedy in the ordinary course of law (Code Civ. Proc.,  1103), and in the absence of special circumstances the right to an immediate review by appeal is considered an adequate remedy. (Phelan v. Superior *582 Court, 35 Cal.2d 363, 370 [217 P.2d 951].) [2] Although section 963 of the Code of Civil Procedure, which designates appealable orders and judgments in civil cases, does not specifically list an order denying a request for leave to file a complaint in intervention, such an order has long been held appealable on the theory that the denial is a final determination of the litigation as to the party seeking to intervene. (Stich v. Goldner (1869), 38 Cal. 608, 610; Dollenmayer v. Pryor, 150 Cal. 1, 3 [87 P. 816]; Braun v. Brown, 13 Cal.2d 130, 133 [87 P.2d 1009]; see People v. Pfeiffer, 59 Cal. 89.) None of the cited cases involved attempted intervention by a person who was, or was claimed to be, a member of a class on whose behalf an action was being prosecuted as a representative suit, but we see no valid reason why the right of appeal should not be afforded to any petitioner who is denied the right to intervene and thus become an active participant in the litigation.
 While the existence of the right to an immediate appeal may constitute an adequate remedy, we are not required to dismiss the proceedings under the circumstances present here. The District Court of Appeal issued alternative writs, considered and determined the matter on the merits and granted a peremptory writ of prohibition. [3] It was, of course, the duty of that court before issuing an alternative writ to determine whether petitioners had another plain, speedy and adequate remedy in the ordinary course of law. Even though we may disagree with the determination of the District Court of Appeal as to the existence of another adequate remedy, it does not follow that we must refuse to allow the use of the writ to test the jurisdiction of the trial court. A final determination of the merits of this controversy at the earliest possible date is of great importance to all the parties, and it would hinder and delay rather than serve the interests of justice if we were, at this stage of the proceedings, to refrain from deciding whether the trial court has acted in excess of its jurisdiction.
 Petitioners assert that their presence as formal or named parties was indispensable to a determination of the issues raised by the complaint and, therefore, that respondent court exceeded its jurisdiction in appointing a receiver, removing a trustee, selecting new trustees in the place of the one who was removed and the two who resigned, and denying petitioners leave to intervene. Section 389 of the Code of Civil Procedure provides that "when a complete determination of *583 the controversy cannot be had without the presence of other parties, the court must then order them to be brought in. ..." As pointed out in Bank of California v. Superior Court, 16 Cal.2d 516, 521 [106 P.2d 879], in applying this section, a distinction has been drawn between necessary and indispensable parties. [4] Where persons are so interested in the controversy that they should normally be made parties in order to enable the court to do complete justice, but their interests are separable from the rest, they are necessary but not indispensable parties. [5] On the other hand, one may be an indispensable party if his interest in the subject matter of the controversy is of such a nature that a final decree cannot be rendered between the other parties to the suit without inevitably affecting that interest. [6] For example, where one person seeks to establish the amount of his share in certain property or in a particular trust fund, other persons with similar interests are indispensable parties.
 [7] Under section 389, it is error, reversible on appeal, to fail to join a necessary party, but unless the absent person is also an indispensable party, the error does not go to the jurisdiction of the court and will not warrant the issuance of prohibition. (Bank of California v. Superior Court, 16 Cal.2d 516, 525-526 [106 P.2d 879]; see Harrington v. Evans, 99 Cal.App.2d 269, 271 [221 P.2d 696].) In the present case there is no question that petitioners are proper parties, and they may even be necessary parties, but they failed to avail themselves of the remedy of appeal and applied instead for prohibition. It becomes necessary, therefore, for us to consider if they are indispensable parties. [8] It may be noted in this connection that, since this is not a collateral attack upon the order of the court, we are not faced with the question of whether the court lacked jurisdiction in the fundamental sense, but rather with the problem of whether the court acted in excess of its jurisdiction as that term is used in determining whether prohibition and certiorari are proper remedies. (See Abelleira v. District Court of Appeal, 17 Cal.2d 280, 287-291 [109 P.2d 942, 132 A.L.R. 715].)
 [9] Upon presentation of the complaint the court had jurisdiction to appoint a receiver without ordering the joinder of other parties. [10] The appointment did not adversely affect any interest of the beneficiaries in the trust property but, to the contrary, was necessary to protect property which undoubtedly would have been lost if the court had refused to take this step. The claims against the Houchin estate *584 would have been barred by the statute of limitations unless filed within three days, and the court was faced with the necessity of taking immediate action to preserve this portion of the trust property. The importance of the trial court's action is indicated by the fact that the filing of claims against the Houchin estate and the bringing of suit thereon in the federal court produced the agreement for settlement by which Miller & Lux Incorporated would receive over two million dollars in cash together with property valued at several million dollars.
 [11] Likewise, the presence of all the beneficiaries of a trust is not indispensable to the removal of a trustee. (Wesson v. Crain, 165 F.2d 6, 9-10; In re Marshall's Will, 78 Ohio App. 1 [65 N.E.2d 523, 525]; Moody v. Branson, 192 Okla. 327 [136 P.2d 925, 927] [denying collateral attack upon removal order].) [12] There can be no question that respondent court had jurisdiction to accept the tendered resignations of the two trustees without first ordering that other persons be joined as parties. The record shows that the third trustee, because of his admitted relationship with the Houchin estate, had interests which were so conflicting with his duties as trustee that his removal was clearly required. [13] A beneficiary has no right to compel the retention of a trustee who is unfit (see Wesson v. Crain, 165 F.2d 6, 9), and under the circumstances presented here the court had authority to remove the third trustee.
 [14] Once the positions of all trustees were vacant, the court was, of course, required to make provision for the care of the trust estate, and it had power to designate the receiver to act as temporary trustee pending appointment of new trustees.
 [15] Under traditional equity practice the courts have power to appoint new trustees in case of vacancy, and, in the absence of a statute to the contrary, it is not necessary to the exercise of this jurisdiction that the beneficiaries of the trust be joined in the proceeding or notified in advance of the court's action. (See Dyer v. Leach, 91 Cal. 191, 193-194 [27 P. 598, 25 Am.St.Rep. 171]; Sanders v. Hall, 74 F.2d 399, 404-405, cert. den. 295 U.S. 739 [55 S.Ct. 653, 79 L.Ed. 1686]; Freeman v. Prendergast, 94 Ga. 369 [21 S.E. 837, 839 et seq.]; Moody v. Branson, 192 Okla. 327 [136 P.2d 925, 927]; Bransford Realty Co. v. Andrews, 128 Tenn. 725 [164 S.W. 1175, 1177-1178].) While the cited decisions involved collateral attack on prior orders, their language supports *585 our conclusion that the court in the present case had power to make the appointments and that it did not act in excess of its jurisdiction as that term is used in determining whether certiorari or prohibition may be issued. (See Abelleira v. District Court of Appeal, 17 Cal.2d 280, 288 et seq. [109 P.2d 942, 132 A.L.R. 715]; Howard v. Superior Court, 25 Cal.2d 784, 787 et seq. [154 P.2d 849].) In the Dyer case, 91 Cal. at pp. 193-194, it was pointed out that the theory of the law is that upon a vacancy in the position of trustee "the trust vests in the court, and, in the absence of a statutory provision, notice is not necessary to confer jurisdiction." The court quoted from a New York decision (Milbank v. Crane, 25 How.Pr. 193) to the effect that the jurisdiction in such a case is "a quasi jurisdiction in rem, a power over the trust, and is not acquired by the service of process. ..." (See also Sanders v. Hall, 74 F.2d 399, 404-405; Bransford Realty Co. v. Andrews, 128 Tenn. 725 [164 S.W. 1175, 1177- 1178].)
 Our statutes contain no express requirement for notice to beneficiaries of a hearing for the appointment of new trustees, but petitioners argue that the provision regarding nominees in section 2287 of the Civil Code indicates a legislative intent that such notice be given. Section 2287 provides that the superior court may appoint a trustee whenever there is a vacancy and that "Other things being equal, the court shall give preference to the nominee of beneficiaries of the trust who are over fourteen years of age." As we have seen, the courts traditionally have had power to appoint a successor trustee without giving notice to the beneficiaries, and we are of the view that if the Legislature had intended to restrict this power it would have done so by a specific provision rather than by leaving the matter to inference. It may be noted that, in the case of testamentary trusts, where the Legislature intended to require notice of hearing of the appointment of successor trustees, it made explicit provision therefor. (Prob. Code,  1125, 1126.) [16] Moreover, petitioners were present at the hearing set for the appointment of new trustees, and, after obtaining permission from the court, they suggested various persons and corporations as successor trustees. Having thus participated in the hearing, without objection on the ground of lack of notice, petitioners are in no position to assert that the court exceeded its jurisdiction in making the appointments.
 The cases of First Nat. etc. Bank v. Superior Court, 19 Cal.2d 409, 414 [121 P.2d 729], Mitau v. Roddan, 149 Cal. 1, *586 6-8 [84 P. 145, 6 L.R.A.N.S. 275], O'Connor v. Irvine, 74 Cal. 435, 443 [16 P. 236], and McPherson v. Parker, 30 Cal. 455, 457 [89 Am.Dec. 129], relied on by petitioners, involved conflicting rights among beneficiaries or between them and the trustees. Accordingly, they come within the rule stated in Bank of California v. Superior Court, 16 Cal.2d 516, 521 [106 P.2d 879], that where a number of persons have undetermined interests in a trust fund and one of them, acting adversely to the others, seeks to recover the whole, to fix his share, or recover a portion claimed by him, the other persons are indispensable parties. In the trustee removal action, however, there were no issues concerning conflicting rights among the different groups of beneficiaries and no questions regarding personal claims to any of the trust property. As we shall see, all beneficiaries of the trust had identical interests in the appointment of a receiver and the change in trustees. The amendment of the complaint in the trustee removal action operated to eliminate all issues relating to accounting by the former trustees and to return of income received by J. Leroy Nickel, Jr. The other matters urged by petitioners as showing a conflict among the beneficiaries, such as the details of prosecuting and financing the suit against the Houchin estate, are not within the issues raised by the complaint, and any objections petitioners may have as to these matters may be raised in appropriate proceedings. Likewise, in view of the amendment withdrawing the demand for an accounting, the federal cases cited by petitioners in which the plaintiff sought to compel the trustee to account for property do not support their claim that they are indispensable parties. (See Baird v. Peoples Bank & Trust Co., 120 F.2d 1001 [136 A.L.R. 693]; Franz v. Buder, 11 F.2d 854; Talbutt v. Security Trust Co., 22 F.Supp. 241.)
 [17] An alternative reason for rejecting the claim that the trial court exceeded its jurisdiction in failing to join petitioners as indispensable parties is that they are represented parties; hence they are parties in legal effect and need not be brought in as formal parties. (Rosicrucian Fellowship v. Rosicrucian etc. Church, 39 Cal.2d 121, 139-140 [245 P.2d 481]; Moore v. Bowes, 8 Cal.2d 162, 165-166 [64 P.2d 423].) The principle applies to those who are indispensable to a complete determination of the controversy as well as to one who is merely a proper or necessary party, and we are of the view that the trustee removal action is a proper representative suit. *587
 [18] Section 382 of the Code of Civil Procedure provides that when a question "is one of a common or general interest, of many persons, or when the parties are numerous, and it is impracticable to bring them all before the court, one or more may sue or defend for the benefit of all." The statute authorizes a representative suit even though it is practicable to join all the parties if those to be represented are "many" and have a common or general interest in the questions presented by the complaint. (Jellen v. O'Brien, 89 Cal.App. 505, 509 [264 P. 1115]; see Carey v. Brown, 58 Cal. 180, 183; Weaver v. Pasadena Tournament of Roses Assn., 32 Cal.2d 833, 837 [198 P.2d 514]; Parker v. Bowron, 40 Cal.2d 344, 352 [254 P.2d 6]; 2 Witkin, California Procedure (1954), 1081.) The term "many" in the statute is indefinite and clearly is sufficiently broad to cover all the various beneficiaries of the Henry Miller trust.
 [19] It is settled that one of the beneficiaries may properly maintain a representative action on behalf of the others with respect to such matters as appointing a receiver, removing trustees, compelling an accounting and impressing a trust upon property purchased with trust money. (Baumann v. Bedford, 18 Cal.2d 366, 371-372 [115 P.2d 437]; Goes v. Perry, 18 Cal.2d 373, 379 [115 P.2d 441]; Moore v. Bowes, 8 Cal.2d 162, 166 [64 P.2d 423]; Farmers etc. Nat. Bank v. Peterson, 5 Cal.2d 601, 605 [55 P.2d 867]; see Peterson v. Donelley, 33 Cal.App.2d 133, 136-137 [91 P.2d 123].) Petitioners contend that this rule is not applicable here because, they assert, there is no community of interest between the life beneficiaries and the remaindermen since the former desire a trust administration which produces a maximum of income and the latter would be benefited by the preservation and enlargement of the corpus of the trust estate. [20] A representative suit is not permissible unless there is a community of interest between the members of the class with respect to the questions of law and fact involved (Parker v. Bowron, 40 Cal.2d 344, 352 [254 P.2d 6]; Weaver v. Pasadena Tournament of Roses Assn., 32 Cal.2d 833, 837-838 [198 P.2d 514]), and a determination of whether a particular plaintiff can fairly protect the rights of the group he purports to represent is necessarily dependent upon the facts and circumstances of each case.
 [21] Although there may be divergent interests between the groups with respect to certain matters not involved here, there is a community of interest among all the beneficiaries *588 as to the issues embraced in the trustee removal action. It was to the advantage of all the beneficiaries to obtain the immediate appointment of a receiver in order to present claims against the Houchin estate, and no valid objection could be made to the removal of the trustee who had conflicting duties. The same facts and legal principles will determine the qualifications of a trustee regardless of the individual desires or preferences of the beneficiaries. No beneficiary has the right to have a particular person selected to serve as trustee, and no trustee can properly act for only some of the beneficiaries--he must represent all of them or he cannot properly represent any of them. Every beneficiary is entitled to trustees who are capable and impartial and who will faithfully execute the trust in accordance with its terms, and these interests are common to all the beneficiaries.
 It thus appears that the questions relating to appointment of a receiver and change of trustees were of common and general interest, and the remaining matters which assertedly gave rise to conflicts in interest were either outside the issues set forth in the original complaint or were removed by amendment. All the requirements of a class suit were present, including the existence of a "community of interest" between the represented parties and the persons representing them. It follows, therefore, that petitioners were in effect parties to the proceedings in the superior court although not formally named as such.
 The trial court did not exceed its jurisdiction in denying petitioners leave to intervene under the provisions of section 387 of the Code of Civil Procedure.  [fn. 5] [22] While it is true that represented parties may intervene and become formal parties in order to participate in the proceedings and protect their interests, the right to intervene is statutory. (See *589 Lindsay-Strathmore Irr. Dist. v. Superior Court, 182 Cal. 315, 326 [187 P. 1056]; Chase v. Evoy, 58 Cal. 348, 355; In re Yokohama Specie Bank, 86 Cal.App.2d 545, 554 [195 P.2d 555]; Fallon v. Superior Court, 33 Cal.App.2d 48, 51 [90 P.2d 858].) [23] In the interests of orderly procedure, a person should be allowed to intervene only if he takes a position on the pleadings in accordance with the requirements of section 387, and a court clearly has power to deny permission to intervene to any applicant failing to comply with the provisions of the statute.
 [24] The proposed complaints in intervention presented by petitioners on June 30 did not meet the requirements of section 387, since it was not alleged that the applicants joined with plaintiffs or united with defendants or demanded anything adversely to both plaintiffs and defendants. When the second complaint in intervention of the Bowles remaindermen was offered during the hearing of the trustees' report on August 2, the court stated that it would not, at that time, consider an applicaion for leave to intervene and that any subsequent motion for such leave should be made on notice. The court was not required to interrupt the hearing in order to consider the proposed pleading, and, in the absence of any showing by petitioners that they made a proper request for intervention, the court was not under a duty to permit the offered pleading to be filed.
 The alternative writs of prohibition are discharged, and a peremptory writ is denied.
 Shenk, J., Carter, J., Traynor, J., Schauer, J., and Spence, J., concurred.
 The Bowles "complaint in intervention" stated that defendants' answers had not been filed, that the Bowles remaindermen were "unable" to "join with plaintiffs" for lack of information with regard to the matters alleged in plaintiffs' complaint, and that they, as beneficiaries, sought to intervene because "in common with the other beneficiaries" they have an interest "in having the administration of the trust investigated and the entire matter reviewed to the end that their interests as such beneficiaries in said trust, and the assets thereof, will be fully and adequately protected in all respects."
NOTES
[fn. 2]  2. The principal asset of the Henry Miller trust is the entire capital stock of defendant Miller & Lux Incorporated. Among the properties of that corporation are: over eighty per cent of the capital stock of defendant San Joaquin Canal Company, which has assets in excess of $4,000,000; over eighty-five per cent of the capital stock of defendant Buena Vista Associates Incorporated, which owns 23,000 acres of farming land in Kern County; and approximately 13,000 acres of productive farm lands as well as stocks, bonds and other securities of the minimum value of $5,500,000.
[fn. 3]  3. The life beneficiaries' complaint stated their interest in the "proper and competent management" of the trust "to the end that the greatest possible income will be received therefrom," and in the appointment of "impartial and competent" trustees and requested leave "to intervene and thereafter participate in the matter in litigation ... as their interests may appear or take such action and file such pleadings as they deem necessary to preserve the corpus of the trust and the distribution of its income."
[fn. 4]  4. The second Bowles complaint declined to join with plaintiffs but stated that it demanded "adversely to defendants" a determination of the matters alleged in plaintiffs' complaint, if and when defendants should file an answer. It also demanded "adversely to defendants" that the trust should not be charged with the fees or costs arising out of the contract entered into between the new trustees and C. Ray Robinson.
[fn. 5]  5. Section 387 of the Code of Civil Procedure reads as follows: "At any time before trial, any person, who has an interest in the matter in litigation, or in the success of either of the parties, or an interest against both, may intervene in the action or proceeding. An intervention takes place when a third person is permitted to become a party to an action or proceeding between other persons either by joining the plaintiff in claiming what is sought by the complaint, or by uniting with the defendant in resisting the claims of the plaintiff, or by demanding anything adversely to both the plaintiff and the defendant, and is made by complaint, setting forth the grounds upon which the intervention rests, filed by leave of the court and served upon the parties to the action or proceeding who have not appeared, and upon the attorneys of the parties who have appeared, who may answer or demur to it within ten days from the service thereof, if served within the county wherein said action is pending, or within thirty days if served elsewhere."
