The legislature of the State of Idaho, in 1947, passed an act cited as “Local License Act” providing for the licensing, regulating, controlling or prohibiting the operation of coin-operated amusement devices, commonly known as slot machines, within the corporate limits of cities and villages and specifically declaring such devices “to be gaming but not lottery.” LC. § 50-1502. The act became effective March 11, 1947. Session Laws of 1947, Ch. 151, p. 359, now appearing as Title 50, Ch. 15, Idaho Code.
Under the act such devices may be lawfully operated only within the corporate limits of cities and villages after the procurement of licenses provided for in the act pursuant to the adoption of ordinances or resolutions, as the case may be, and providing further that the operation of such devices without a license is unlawful and subject to the penalties provided for in the act.
With reference to the license requirement under the act, Section 50-1506, I.C., provides as follows:
“License fees. — The license fee imposed and collected by the local. authority shall be not less than $500.00 per annum for the calendar year for each coin-operated amusement device, which license fee may be pro rated as of the actual month of issue for the remainder of the license year. Of the license fee so collected $125.00 shall be collected for the state of Idaho and remitted quarterly by the collecting local authority to the state treasurer and by him placed in the general fund of the state; of the license fee so collected $125.00 shall be collected for the county *39in which the collecting local authority is located and shall be by said collecting local authority remitted quarterly to the treasurer of such county and by him placed in the general fund of such county; provided, however, if the license is issued for less than the full calendar year, the amounts so collected for the state and for the county respectively shall be pro rated as of the actual month of issue.”
Pursuant to the act and by virtue of the authority therein given to incorporated cities and villages, the City of Gooding on April 1, 1947, adopted Ordinance No. 252 which in all essential aspects conformed with and referred to the provisions of the state “Local License Act”. The licensing provisions of the ordinance provides for an annual license fee of 50% of the gross amount deposited in each machine but in no event should the license fee be less than $500 per year for each machine which must be paid at the time the application for a license is made. The ordinance further in this respect expressly provides the city shall collect for and on behalf of the State of Idaho the sum of $125 per year on each machine so licensed for a year, or the pro rata share of license for less than a year, and remit such sum to the treasurer of the State quarterly on the first day of the months of April, July, October and January.
From ánd after the enactment of the ordinance and at all times prior to January 1, 1949, the City of Gooding remitted quarterly to the state treasurer the State’s share of such license fees. During the period from January 1, 1949, to September 30, 1950, the city, pursuant to such statute and ordinance, collected license fees in the sum of $7,310.11 for and payable to the state treasurer and failed, neglected and refused to remit such sum, or any part thereof, to the state treasurer although demand for such payment was duly made.
Thereafter the State filed an action against the city to collect said sum of $7,-310.11, together with interest accrued thereon.
The sole and only ground of defense in the amended answer of the city urged here is that the provisions of the so-called slot machine act, T. 50, Ch. 15, I.C., is unconstitutional under the provisions of Art. 3, § 20, of the Idaho Constitution.
The matter was tried before the court, the parties waiving a jury. At the conclusion of the trial the court made its findings of fact and conclusions of law, denying plaintiff any relief and entered judgment for the City of Gooding on the ground that the so-called slot machine act violates Art. 3, § 20, of the State Constitution which provides as follows:
“Lotteries not to be authorized.— The legislature shall not authorize any lottery or gift enterprise under any pretense or for any purpose whatever.” ■ From the judgment for the city, the State
appealed.
*40 It is a firmly established principle of law, of uniform application, that the constitutionality of a statute may not be questioned by one whose rights have not been or are not about to be injuriously affected by the operation of such statute, Poffenroth v. Culinary Workers Union, 71 Idaho 412, 232 P.2d 968; Twin Falls Canal Co. v. Huff, 58 Idaho 587, 76 P.2d 923; Powell v. McKelvey, 56 Idaho 291, 53 P.2d 626; In re Brainard, 55 Idaho 153, 39 P.2d 769; In re Allmon, 50 Idaho 223, 294 P. 528; Williams v. Baldridge, 48 Idaho 618, 284 P. 203; 16 C.J.S., Constitutional Law, § 76, p. 157, or as stated differently, unless it is being or is about to be applied to his disadvantage, or he will be injured by its enforcement. State v. Heitz, 72 Idaho 107, 238 P.2d 439; Albrethsen v. State, 60 Idaho 715, 96 P.2d 437, or where, pursuant to the authority conferred by such statute, one has voluntarily claimed and aocepted its benefits, Henderson v. Twin Falls County, 59 Idaho 97, 80 P.2d 801; Taylor v. Girard, 54 Idaho 787, 36 P.2d 773; Brady v. Place,
41 Idaho 747, 242 P. 314, 243 P. 654; Sacramento County v. City of Sacramento, 75 Cal.App.2d 436, 171 P.2d 477; Foster v. Superior Court, 26 Cal.App.2d 230, 79 P.2d 144; McMahon v. Cooney, 95 Mont. 138, 25 P.2d 131; Buck v. Kuykendall, 267 U.S. 307, 45 S.Ct. 324, 69 L.Ed. 623, 38 A.L.R. 286; Daniels v. Tearney, 102 U.S. 415, 26 L.Ed. 187; Grand Rapids & Indiana Railway Co. v. Osborn, 193 U.S. 17, 24 S.Ct. 310, 48 L.Ed. 598. See also State ex rel. City of Wolf Point v. McFarlan, 78 Mont. 156, 252 P. 805; Brockman v. Contractors Licensing Board, 48 N.Mex. 304, 150 P.2d 125; 16 C.J.S., Constitutional Law, §§ 89 and 90, pp. 184 and 191; 11 Am.Jur., Secs. 121 and 123, pp. 766 and 767.
The principle applies not only to an individual but also to the State, Albrethsen v. State, 60 Idaho 715, 96 P.2d 437, to a county, Henderson v. Twin Falls County, 59 Idaho 97, 80 P.2d 801; Farrell v. Placer County, 23 Cal.2d 624, 145 P.2d 570, 153. A.L.R. 323; Riverton Valley D. Dist. v. Board of County Com’rs, 52 Wyo. 336, 74 P.2d 871, 114 A.L.R. 1093, or to a city, Sacramento County v. City of Sacramento, 75 Cal.App.2d 436,171 P.2d 477; Belhassen v. Town of Iaeger, 112 W.Va. 598, 166 S.E. 10; 16 C.J.S., Constitutional Law, § 76, p. 168, note 1.
An examination of the record in this case, as well as the authorities presented and the argument made for and on behalf of the City, discloses that the rights of the city have not been or are not about to be adversely affected by the operation of the statute or that the statute has been or is about to be applied to its disadvantage or injury; indeed the city advances no such contention and the record reveals the contrary; moreover, it affirmatively appears that the statute challenged conferred power and authority upon the city to prohibit the licensing and operation of such devices within the city, yet it voluntarily took advantage of the alternative under the statute, that is, the licensing, operation and regula*41tion of such devices when it adopted an ordinance and exacted, claimed and accepted substantial financial benefits thereunder. It was not content to exact the minimum license of $500 a machine and retain 50% thereof for itself but by such ordinance it exacted a license fee of 50% of the gross amount deposited in each machine over and above the initial $500 fee or the pro rata part thereof in the event any machine was not licensed for the full calendar year. Under the ordinance, the city elected to and did participate with the owners in sharing in the gross profits realized from the operation of such machines.
The position of the city presents an unusual situation; it seeks to challenge the constitutionality .of the statute which is the source of . its authority and power to exact and collect such license fees; it seeks by such a defense to be relieved of the obligation to remit tó" the State funds which, under both the statute and the ordinance, are declared to belong to the State; it in effect concedes the claim of the State to be otherwise just but refused to remit and seeks to retain such funds for its own use and benefit only because it asserts that the statute is unconstitutional; the city has not. been injured nor is it immediately threatened with injury under the statute; on. the contrary, by the authority of the statute which it voluntarily took advantage of, it has and still does enjoy substantial benefits from its authority and operation. It is clear that the statute has not nor is it abo.ut to be applied to the disadvantage of the city; neither has the city been injured nor is it threatened with injury by its enforcement. Its position under the record is no different than that of any other litigant and hence it may not question the constitutionality of the statute.
In the case of Sacramento County v. City of Sacramento, 75 Cal.App.2d 436, 171 P.2d 477, a somewhat analogous situation arose and the California court applied the rule against a city as this 'court applies' it here. There, Sacramento, though not! required to, adopted the Municipal Court system by the vote of the people, pursuant to a state statute. Under the statute the city was required to reimburse the county for: all costs in excess of $25,000 a .year for, the maintenance of the municipal court, irrespective of whether such expenses were incurred for the benefit of the county alone or .for both. During the. particular fiscal year the county paid out for the maintenance of the court in excess of $61,000. Demand was made upon the city to feim — , burse the county for all in excess of $25,-; 000. Upon the refusal of the city to;pay a. substantial portion of the amount, the county brought an action for its recovery; Although it clearly appeared that the city ob-a tained-benefits from the statute, it-elected; to defend the action on the ground that • the: statute was unconstitutional; and hence as-.; sail the statute under which it had obtained benefits. In denying the-city the right to question the.constitutionality of the statute; *42the court clearly- and aptly made an observation which is strikingly appropriate here:
“It must be presumed to have weighed the advantages of the new system as against its disadvantages, if any, and concluded in favor of the adoption of the system. We cannot assume that it was acting for other than what it presumed would be its own advantage; and having accepted the benefits of the statute it is now in no position to question its constitutionality.”
The following statement made by the court in the case of People v. Fidelity & Deposit Co. of Maryland, 28 Cal.App.2d 325, 82 P.2d 495 at page 498, is particularly fitting:
“Neither justice nor common sense-permit the state to accept the benefits of the enactment with one hand, and use the other to void the very provisions that create those same benefits.”
Moreover, it is a rule of uniform application based upon firm grounds of public policy, repeatedly reiterated by this court, that the constitutionality of a statute will not be determined in any case unless such determination is absolutely necessary in order to determine the merits of the action in which the statute has been drawn in question. State v. Heitz, 72 Idaho 107, 238 P.2d 439; Poffenroth v. Culinary Workers Union, 71 Idaho 412, 232 P.2d 968; McLean v. Hecla Min. Co., 62 Idaho 75, 108 P.2d 299; Albrethsen v. State, 60 Idaho 715, 96 P.2d 437; United Mercury Mines Co. v. Pfost, 57 Idaho 293, 65 P.2d 152; In re Brainard, 55 Idaho 153, 39 P.2d 769; Garrity v. Board of County Com’rs, 54 Idaho 342, 34 P.2d 949; State Ins. Fund v. Board of Com’rs, 54 Idaho 359, 34 P.2d 956; State ex rel. Macey v. Johnson, 50 Idaho 363, 296 P. 588; In re Allmon, 50 Idaho 223, 294 P. 528; Logan v. Carter, 49 Idaho 393, 288 P. 424; Knoor v. Reineke, 38 Idaho 658, 224 P. 84; Abrams v. Jones, 35 Idaho 532, 207 P. 724; Kimbley v. Adair, 32 Idaho 790, 189 P. 53; Greene v. Rice, 32 Idaho 504, 186 P. 249; Howard v. Grimes Pass Placer Min. Co., 21 Idaho 12, 120 P. 170; Mills Novelty Co. v. Dunbar, 11 Idaho 671, 83 P. 932; Jack v. Village of Grangeville, 9 Idaho 291, 74 P. 969; McGinness v. Davis, 7 Idaho 665, 65 P. 364; In re Marshall, 6 Idaho 516, 56 P. 470; State v. Baker, 6 Idaho 496, 56 P. 81; Howell v. Board of Com’rs, 6 Idaho 154, 53 P. 542; State v. Ridenbaugh, 5 Idaho 710, 51 P. 750. See also Thomas v. Riggs, 67 Idaho 223, 175 P.2d 404; 16 C.J.S., Constitutional Law, § 94, p. 208, note 43.
We conclude that the city has shown no injury under the statute nor that the statute is being or is about to be applied to the disadvantage of the city with reference to the subject matter of this action and that it may not in this action question the constitutionality of the statute; moreover, it is not absolutely necessary in this action, in order to determine the merits thereof, that the court pass upon the constitutionality of *43the statute in question and thus we do not herein pass upon its constitutionality in any respect.
The judgment should be and hereby is reversed and the cause remanded with directions to enter judgment for plaintiff as prayed.
Costs to appellant.
PORTER, C. J., and GIVENS and KEE-TON, JJ., concur.