
105 N.J. Super. 72 (1969)
251 A.2d 147
SILCO AUTOMATIC VENDING COMPANY, A NEW JERSEY CORPORATION, PLAINTIFF,
v.
FRANK A. PUMA, LICENSE INSPECTOR, CENTRAL LICENSE BUREAU, CITY OF ELIZABETH AND THE MAYOR & CITY COUNCIL OF THE CITY OF ELIZABETH, A MUNICIPAL CORPORATION OF THE STATE OF NEW JERSEY, DEFENDANTS. DIERICKX MUSIC, INC., A NEW JERSEY CORPORATION, PLAINTIFF,
v.
FRANK A. PUMA, LICENSE INSPECTOR OF THE CITY OF ELIZABETH AND THE MAYOR & CITY COUNCIL OF THE CITY OF ELIZABETH, DEFENDANTS.
Superior Court of New Jersey, Law Division.
Decided February 5, 1969.
*79 Mr. Allan Gutfleish for plaintiff Silco Automatic Vending Company (Messrs. Weitz, Gutfleish and Wurtzel, attorneys).
Mr. Joseph A. Hayden for plaintiff Dierickx Music, Inc.
Mr. Frank P. Trocino, First Assistant City Attorney, for defendants (Mr. Edward W. McGrath, City Attorney, attorney; Mr. John R. Weigel on the brief).
FELLER, J.S.C.
These consolidated actions in lieu of prerogative writs seek to compel the issuance of coin-operated music machine licenses and to declare invalid section 7 of ordinance 260 of the City of Elizabeth.
With reference to the Silco Automatic Vending Company case it is stipulated that when the ordinance was enacted on February 8, 1967, and ever since that time, there were never any licenses available because those outstanding were in excess of the number allowed by the ordinance. At present there are 272 coin-operated music system licenses and 192 for other types of amusement devices. Puma is *80 the license inspector of Elizabeth. Examination of applicants under ordinance 260 is not his sole function; there are others. When he receives an application for an operator's license under the ordinance he sends it to the police department to check on the background and criminal record of the parties involved in order to determine whether they meet the ordinance requirements. The police department then sends the application to the State Police Bureau and the Federal Bureau of Investigation to determine if there were any offenses committed by the persons named in the application. The police department makes no charge for the work so performed. The budget for Puma's department was approximately $12,700 for 1966, $13,700 for 1967, and $14,100 for 1968. There are 12 individuals who hold an operator's license (fee $100) where only one music machine is involved, four people who hold licenses for more than one music machine (fee $200), two who pay a $2,000 operator's license.
Plaintiff applied for a license in June 1966. On July 6, 1966 its counsel said that if he did not hear from Puma by July 8 he would assume the application had been disapproved and immediately commenced a suit requiring that the license be issued; that Puma wrote on July 7, 1966 acknowledging receipt of the letter and stating that Silco's application had been referred to the police department for the customary investigation, and that upon receipt of its report and recommendations he would notify counsel; that no other word was ever received from Puma and his files do not show the receipt of any police report on Silco; that there is no derogatory information in Puma's files as of then or now concerning Silco.
The following stipulations were made by counsel in the Dierickx Music, Inc. case:
Plaintiff applied on June 7, 1966 for an operator's license under the then existing ordinance and paid the prescribed fee to the license inspector. The inspector rejected the application solely on the ground that the applicant *81 was a nonresident of Elizabeth and therefore barred by the provisions of the ordinance. This resulted in court proceedings in December 1966, in which it was held that the section of the ordinance barring nonresidents was unconstitutional. On January 10, 1967 Dierickx' attorney wrote license inspector Puma demanding that he issue the license applied for the preceding June since the bar to its issuance was now removed. Puma replied, advising that no new licenses were being issued because there was then pending before the city council a new ordinance regulating coin-operated music devices. The check that had accompanied the original application was returned. On January 26, 1967 Dierickx applied for a license under new ordinance 260 and tendered the prescribed fee. The license inspector returned the check with a letter advising that a license could not be issued because the licenses than in existence exceeded those permitted by the ordinance.

I
Section 1 of ordinance 260 provides as follows:
"On and after the effective date of this Ordinance, the operation and maintenance of pool and billiard tables, bowling alleys, music and all other amusement or entertainment machines or devices in which coins are inserted, within the City of Elizabeth, in public or quasi-public places, or in any public building, store or other place wherein the public are invited, or wherein the public may enter, shall be licensed by the License Inspector of the City of Elizabeth, and no person shall place, operate or maintain the same without having first obtained a license for that purpose."
Plaintiffs contend that Elizabeth is without statutory authority to enact an ordinance providing for the licensing of coin-operated music machines. Defendants contend that the statutes give the municipality such authority.
N.J.S.A. 40:52-1(f) provides that
"The governing body may make, amend, repeal and enforce ordinances to license and regulate:


*82 * * * * * * * *
f. Theatres, cinema and show houses, opera houses, concert halls, dance halls, pool or billiard parlors, bowling alleys, exhibition grounds, and all other places of public amusement, circuses and traveling or other shows, plays, dances, exhibitions, concerts, theatrical performances, and all street parades in connection therewith." (Italics supplied)
A municipality ordinarily may regulate the use of juke boxes, mechanical music machines, player pianos, phonographs and radios, where they are employed for amusement on a commercial basis or in commercial places, such as restaurants, ice cream parlors, saloons and dance halls, and may impose penalties for violation of its regulations. Authority to regulate these instruments may be derived from a grant of power to regulate "amusements," or in any event, under the municipal police power to protect and preserve the public morals and welfare. Theatrical, operatic and musical performances and motion picture shows have always been recognized as proper subjects of police inspection and control. In comparison, regulation and supervison of commercially operated juke boxes is, at best, merely a question of degree.
While mechanical music machines, including juke boxes, are not nuisances per se, they may become nuisances in fact where, by reason of the manner in which they are managed, their location and other circumstances, they are harmful to the public morals or welfare. The fact that they can be located in many places and that there is broad opportunity to select records of varying quality and worth makes it desirable to protect the public morals and welfare with respect to them.
Municipal regulation of music machines may relate to their possession, location, installation, and use or manner of operation, i.e., pieces played and manner of playing. Accordingly, an ordinance may prohibit the playing of such instruments at any place where they disturb the peace and quiet of the neighborhood. The municipality may also *83 prohibit the playing of vulgar or obscene selections. Provision for periodic inspections insures that juke boxes and the like do not become public nuisances. An ordinance like the one under consideration must, of course, be reasonable and not oppressive or discriminatory. But it is not void as discriminatory merely because it is not applicable to music stores which occasionally play phonographs or radios near their doorways to attract customers.
It is a general rule that legislative determinations embodied in municipal ordinances are for the duly constituted municipal authorities and not for the courts, and that the wisdom of municipal legislation is not for the judiciary but for the municipal legislative body. Hence, a court is not concerned with the merit or wisdom of municipal legislation on juke boxes and mechanical players. However, the power of a municipality to enact such legislation must be determined by a court when the issue properly is before it. Accordingly, the relationship of such legislation to the public safety, morals and general welfare, its reasonableness, whether or not it is discriminatory  all being questions going to the municipal power, are subject to judicial review. More specifically, it is for the courts to determine whether particular automatic musical instruments or the like are proper subjects for the exercise of the police power and whether the regulation of such instruments is reasonably necessary to the comfort, morals, safety or welfare of the community, since these questions relate to the existence of municipal power. But a court cannot judicially declare that an ordinance which aims at regulation of commercial juke boxes and their inspection is so patently arbitrary and so unreasonable an interference with legitimate business as not to be warranted by any rational considerations of public safety, morals and general welfare. 7 McQuillin, Municipal Corporations (3d ed.), sec. 24.215, pp. 40-43. See also Lamere v. City of Chicago, 391 Ill. 552, 63 N.E.2d 863, 866 (Sup. Ct. 1945).
*84 Thus, N.J.S.A. 40:52-1(f), which gives to municipalities the power to regulate places of public amusement, would seem to give to municipalities the statutory authority to license coin-operated music machines in furtherance of the police power to regulate public amusements.
This conclusion is in harmony with Art. IV, sec. 7, par. 11 of the New Jersey Constitution (1947) which provides in effect that any law concerning municipal corporations formed for local government shall be liberally construed in their favor, and the powers of such municipal corporations includes not only those granted in express terms, but also those of necessary or fair implication or incident to the powers expressly conferred or essential thereto and not inconsistent with or prohibited by the State Constitution or by law.
Courts are enjoined by our Constitution, Home Rule Act and Optional Municipal Charter Law to interpret statutes liberally in favor of existence of local power to deal with local needs. Whelan v. New Jersey Power and Light Co., 45 N.J. 237, 251 (1965).
N.J.S.A. 40:52-1 does not specifically authorize municipalities to license juke box machines and the cases do not seem to clarify this question.
In Gilbert v. Town of Irvington, 20 N.J. 432 (1956), the court held that the ordinance establishing fees for the licensing of coin-operated milk vending machines was unreasonable, discriminatory and confiscatory, and was illegal and void because the fees charged were excessive. However, the court stated (at pp. 435 and 436) that the power of a municipality to regulate or license emanates from N.J.S.A. 40:52-1 and N.J.S.A. 40:52-2, and the right of a municipality to do so and to exact fees for revenue is dependent upon and limited by the power so conferred. However, the court did not designate the subsection of the above statutes which authorizes the licensing of coin-operated milk vending machines. Apparently there is no such provision included in N.J.S.A. 40:52-1.
*85 N.J.S.A. 40:52-2 gives the governing body the right to fix the fees for licenses, which may be imposed for revenue; to prohibit all unlicensed persons and places and vehicles, businesses and occupations from acting, being used or carried on, and to impose penalties for violations of licensing ordinances and to revoke any license for sufficient cause.
In Mayor & Council of City of Hoboken v. Bauer, 137 N.J.L. 327 (Sup. Ct. 1948), the ordinance provided, among other things, for the regulation and control of the use of automatic musical instruments and the like, and provided that such machines should not be installed without a license. The court held that the ordinance was in conflict with the Fourteenth Amendment of the United States Constitution and Art. I, par. 1 of the New Jersey Constitution (1844) because it did not set up any norm or standards for the supervision of licenses. However, the court said nothing about any statute which authorized the adoption of said ordinance. Apparently, this question was not raised.
N.J.S.A. 40:48-1(20) provides, in effect, that the governing body of every municipality may make, amend, repeal and enforce ordinances to regulate machinery, scenery, lights, wires and other apparatus, equipment or appliances used in all places of public amusement. Thus, a governing body is given the authority to regulate apparatus, equipment and appliances in all places of public amusement.
N.J.S.A. 40:48-2 provides as follows:
"Any municipality may make, amend, repeal and enforce such other ordinances, regulations, rules and by-laws not contrary to the laws of this State or of the United States, as it may deem necessary and proper for the good government, order and protection of persons and property, and for the preservation of the public health, safety and welfare of the municipality and its inhabitants, and as may be necessary to carry into effect the powers and duties conferred and imposed by this subtitle, or by any law."
This section constitutes an express grant of broad general police powers to a municipality, and under it a municipality can take such action as it deems necessary for the good government, *86 order and protection of persons and property and the health and general welfare of the municipality, subject to constitutional and statutory limitations. Kirzenbaum v. Paulus, 51 N.J. Super. 186 (Law Div. 1958), affirmed 57 N.J. Super. 80 (App. Div. 1959).
Thus, in the event that an enumerated power is not deemed sufficient (such as N.J.S.A. 40:52-1 in this case), and provided the ordinance adopted is not contrary to the laws of this State or of the United States, by N.J.S.A. 40:48-2 a municipality may pass an ordinance as long as it is for any of the purposes set out therein. This section is an express grant of broad general police powers to muncipalities. Fred v. Mayor, etc., of Old Tappan, 10 N.J. 515 (1952). However, it is not a licensing statute.
In Fred the court said:
"The suggestion is made that the Legislature has provided other more specific methods of dealing with the problems arising from the removal of soil and that, therefore, an ordinance regulating such removal is inconsistent with these other methods. Admittedly when the Legislature has prescribed the procedure for dealing with specific local problems, a municipality is not free to deal with those problems without regard for the legislative prescription, Magnolia Development Co., Inc. v. Coles, supra, 10 N.J. 223, 227 (1952). In the instant case, however, we discern no other legislative scheme subverted by a regulatory ordinance of the type here involved." (at p. 521)
Applying this rule to the present case, it would seem that under N.J.S.A. 40:52-1 the Legislature has provided more specific methods of dealing with the power to license. However, in the instant case, under the provisions of N.J.S.A. 40:48-1(20), N.J.S.A. 40:49-2 and N.J.S.A. 40:52-1(f) there seems to be no legislative scheme subverted by a regulatory ordinance of the type here involved.
The New Jersey State League of Municipalities has furnished information to the effect that 71 municipalities had similar ordinances as of two years ago. The fact that they all have enacted juke box license ordinances should *87 be considered in determining the question of the validity of this ordinance. In re Hudson County, 106 N.J.L 62, 75 (E. & A. 1928). See also Presbyterian Church of Livingston v. Division of Alcoholic Beverage Control, 53 N.J. Super. 271 (App. Div. 1958); State v. Kelsey, 44 N.J.L. 1 (Sup. Ct. 1882); 2 Sutherland, Statutory Construction (2d ed.) sec. 477, p. 895. Among these municipalities are: Camden, Cranford, East Orange, Hoboken, Irvington, Jersey City, Kenilworth, Maplewood, Metuchen, New Brunswick, Paramus, Princeton, South Amboy, Scotch Plains, Trenton and Westfield.
Therefore, it would seem that under the provisions of N.J.S.A. 40:48-1(20), N.J.S.A. 40:48-2 and N.J.S.A. 40:52-1(f), the power of municipalities to license coin-operated music machines can be "spelled out."

II
Plaintiffs contend that section 7 of Elizabeth ordinance No. 260 is invalid and unconstitutional in that it arbitrarily limits the number of licenses. Section 7 provides:
"The number of music machines in the City of Elizabeth and all other amusement devices in which coins are inserted, shall be limited as follows: (a) in the case of music machines, licenses shall be issued for no more than two hundred fifty (250) machines, and (b) in the case of all other types of amusement and entertainment machines or devices, licenses shall be issued for no more than two hundred (200); provided, however, that nothing herein contained shall be deemed to prohibit the renewal of any existing license, the substitution of any licensed machine or transfer of a license for a machine from one premises to another pursuant to the provisions of this Ordinance."
Plaintiffs argue that this ordinance violates the Equal Protection Clause of the Fourteenth Amendment of the United States Constitution, and further, that there is no statutory authority granting municipalities the right to place a limitation on licenses of this type.
*88 Juke boxes and similar machines placed in taverns, restaurants, dine-and-dance establishments, and other places of public resort are subject to police supervision and licensing under the police power. 8 McQuillin, Municipal Corporations (3d ed.), sec. 26.153, p. 400.
The constitutional provisions that any law concerning municipal corporations formed for local government shall be liberally construed in their favor has been declared fully applicable to a business and occupation licensing ordinance. Brough of Brielle v. Zeigler, 73 N.J. Super. 352 (Cty Ct. 1962). As stated supra, this constitutional provision states that the power of such municipal corporations includes not only those granted in express terms, but also those of necessary or fair implication or incident to the power expressly conferred or essential thereto and not inconsistent with or prohibited by the New Jersey Constitution or law.
Under this provision, does Elizabeth, which has the power to issue music machine licenses, also have the power to restrict the number of licenses issued under the necessary or implied powers incident to the powers conferred in furtherance of the police power?
The tendency in this State before the adoption of the 1947 Constitution was to prohibit the limitation of licenses without specific statutory authority. See McKim v. Village of South Orange, 133 N.J.L. 470 (Sup. Ct. 1945). N.J.S.A. 33:1-40, which limits the number of licenses to sell alcoholic beverages at retail and gives the governing body the right to enact by ordinance that no more than one retail license shall be granted, and N.J.S.A. 40:162A-2, which gives the governing body of any village in counties of the first class the right to limit the number of public scavenger licenses in the village to one or more in accordance with the needs and best interest of the village, were enacted before 1947.
It should be noted, however, that these two statutes give the authority to limit these types of licenses to one. This is vastly different from the present case where Elizabeth limits *89 the number of licenses to 200 and 250. Furthermore, if plaintiffs are correct in contending that section 7 violates the Equal Protection Clause of the Fourteenth Amendment, then N.J.S.A. 33:1-40 and N.J.S.A. 40:162A-2, which permit the adoption of ordinances limiting the number of certain types of licenses, are also a violation of that clause.
The Fourteenth Amendment is applicable to state statutes as well as municipal ordinances. 9 McQuillin, op. cit. (3d rev. ed.), sec. 26.191, p. 493, states that generally, under the power to regulate and license liquor vending places, a municipal corporation can limit the number of licenses to be issued to vendors and vending establishments. Town of West Hartford v. Willets, 126 Conn. 266, 5 A.2d 13 (Sup. Ct. Err. 1939); Gartland v. Talbott, 72 Idaho 125, 237 P.2d 1067 (Sup. Ct. 1951); State ex rel. Howie v. Common Council of City of Northfield, 94 Minn. 81, 101 N.W. 1063 (Sup. Ct. 1902); State ex rel. Dixie Inn v. City of Miami, 156 Fla. 784, 24 So.2d 705, 163 A.L.R. 577 (Sup. Ct. 1946). An ordinance limiting the number of licensed liquor outlets is a regulatory, as distinguished from a prohibitive, measure and it should be based on a determination by municipal legislative authorities of a policy in the public interest. An ordinance must be enacted or a formal regulation adopted and promulgated. 9 McQuillin, op. cit., sec. 26.191, p. 494; Borough of Fanwood v. Rocco, 33 N.J. 404 (1960).
Cutaio v. Board of Health of City of Elizabeth, 36 N.J. Super. 565 (App. Div. 1955), involved an ordinance which limited to 20 the number of licenses for poultry slaughter houses. The court said (at p. 569) that "We are not concerned with the validity of the numerical limitation and express no opinion on it."
Furthermore, in Borough of Fanwood v. Rocco, supra, the court stated:
"Indeed, even where the municipal governing body passes an ordinance limiting the number of taverns and package stores it may reasonably decline to issue a license beyond a number less than the maximum prescribed in the ordinance." (at p. 412) *90 And in Bumball v. Burnett, 115 N.J.L. 254 (Sup. Ct. 1935), the court held:
"Apart from this, and assuming the facts claimed, to wit, that the ordinance itself placed no limit on the number of licenses to be issued, and the resolution of council to grant no more, was adopted after prosecutor's application and one other were already filed, we see no illegality whatever in the refusal of a particular license, at least so long as the refusal is not shown to be fraudulent, corrupt, or inspired by improper motives. Nothing of the kind appears in this case. Prosecutor argues apparently that a liquor license is to be obtained and is obtainable on the same theory as a license to carry on, say a grocery business, demandable by any respectable citizen on payment of the prescribed fee: but that is not the case. The sale of intoxicating liquor is in a class by itself. Paul v. Gloucester County, 50 N.J.L. 585, 595. `No one has a right to demand a license; license is a special privilege granted to the few, denied to the many.' Id. 596. `There is no inherent right in a citizen to sell intoxicating liquors by retail. It is not a privilege of a citizen of the State of the United States.' Meehan v. Board of Excise Com'rs, 29 N.J.L.J. 370 [73 N.J. Law, 382], 64 Atl. Rep. 689. See, also, Hagan v. Town of Boonton, 62 N.J.L. 150.
One phase of the present argument for the writ seems to be that as the ordinance (as claimed) says nothing about the number of licenses to be issued, the borough council has no power to call a halt until, with a slate clean of pending applications, it ordains a limit, or at least fixes a limit by resolution: but we see no merit in this. If the ordinance had fixed one hundred as a limit, still the council, in its discretionary power to license or not to license, could stop short of that number at any point, or could license A and refuse B. As a matter of history, in this very county of Somerset a quarter of a century ago, when licenses were controlled by the Court of Common Pleas, and there was no legal limit on the number, that court announced that, in its opinion, there were enough licensed places in the county, and no more licenses would be granted until further order. No question of the legality of this action was ever formally raised." (at pp. 255-256)
Although the cases cited from New Jersey and other states apply principally to liquor licenses, the limitation of these licenses is a valid exercise of the police power, just as the limitation of licenses for juke boxes is a legitimate exercise of the police power. Such limitation is not prohibitory. In Gartland v. Talbott, supra, the court said:
*91 "A limitation of the number of licenses which will be issued for the sale of intoxicants within a municipality or within a given area is not of itself prohibitory, and is recognized as a legitimate regulation tending to promote public health, safety and welfare within the police power."
Furthermore, in State ex rel. Howie v. Common Council of Northfield, supra, the court held (at pp. 1063-1064) that the power given to council to regulate and control licenses to sell intoxicating liquor includes the power to do all that is deemed in the judgment of council for the best interests of the municipality and its inhabitants. It necessarily confers the power to limit the number of licenses to be granted when, in the judgment of council, the welfare of the city suggests such action. As the Northfield court said, if the authorities were required to license every applicant who complied with a prescribed set of conditions, the authority would be changed from one of regulation and control to one of taxation. See also State ex rel Hewlett v. Womach, 355 Mo. 486, 196 S.W.2d 809 (Sup. Ct. 1946); Landman v. Kizer, 195 Tenn. 13, 255 S.W.2d 6 (Sup. Ct. 1953). Were a municipality required to issue licenses to every applicant who complied with the standards, it is possible that this would create a situation which would confront the police with an impossible task of police inspection and control.
In view of the above authorities, it would seem that the power given to the governing body in the present case to limit the number of coin-operated music machines under section 7 of the ordinance is not of itself prohibitory and is a legitimate regulation tending to promote health, safety and welfare within the police power. If, in the judgment of that body, the best interests of the city require such regulation, this power to limit the number of licenses is a proper exercise of the police power.
The power to regulate gives authority to impose reasonable restrictions and restraints upon the activity or matter regulated. The power to regulate implies a power of restrictions and restraint, not only as to the manner of conducting *92 a specific business or other activity, but also as to the place in or upon which activity is to be conducted, 2 McQuillin, Municipal Corporations (3d ed.), sec. 10:26, p. 806, and this power to regulate is permissible under the police power and is ordinarily confined to such reasonable restraints upon the trade or business made the subject thereof as may be demanded by the public interest. N.J. Good Humor, Inc. v. Board of Com'rs of Borough of Bradley Beach, 124 N.J.L. 162, 170, 171 (E. & A. 1939).
As stated, the Fourteenth Amendment applies to municipal ordinances as well as state statutes. See Railway Express Agency v. New York, 336 U.S. 106, 69 S.Ct. 463, 93 L.Ed. 533 (1949). However, R.S. 33:1-40 and N.J.S.A. 40:162A-2, were enacted before the 1947 Constitution was adopted with its provision for liberal construction of laws in favor of municipalities. Before its adoption, such laws were strictly construed. Before 1947 our courts held that reasonable doubt concerning the existence of the power of a municipality was resolved against the municipality. Meday v. Borough of Rutherford, 65 N.J.L. 645 (E. & A. 1900); Federal Shipbuilding & Dry Dock Co. v. City of Bayonne, 102 N.J. Eq. 475 (Ch. 1928), affirmed 104 N.J. Eq. 196 (E. & A. 1928). The courts also stated the rule that municipalities must be confined within the limits which a strict construction of statutory grants of powers to them will assign to them. Appeals of Jersey City, 23 N.J. Misc. 311 (Tax Dept. 1945). However, municipal ordinances carry a presumption of validity and when the power of a municipal corporation to accomplish a result is questioned, the municipality is favored under the Constitution of 1947, since municipalities not only have all powers expressly delegated to them, but also those powers which can be fairly implied by reference to the language expressly delegating powers.
Thus, where there are two possible interpretations of a statute or ordinance, the one which will uphold the law is to be adopted in preference to the one under which the law *93 will be unconstitutional. Adams Newark Theatre Co. v. City of Newark, 22 N.J. 472 (1956).
Therefore, it is the opinion of this court that section 7 of the ordinance does not violate the Equal Protection Clause of the Fourteenth Amendment of the United States Constitution and is a valid exercise of the police power.

III
Plaintiffs contend that since this court had on December 8, 1966 declared unconstitutional that provision of the local ordinance which excluded nonresident applicants for juke box licenses, the city was able to circumvent this decision by enacting section 7, which by limiting the number of licenses did in effect continue in operation the local merchants who had secured their licenses because they were residents of Elizabeth.
With reference to this question, the general rule is that an ordinance operates only prospectively as to licenses or permits when it contains no provision of exception or reservation against its application to existing licenses or permits. Accordingly, an ordinance passed after the granting of a license or permit does not affect it except when the ordinance does so by express provision or necessary implication. Generally, however, an ordinance which validly prohibits a certain business, activity or building, the prohibition beng within the police power of the city, can by its terms be made to operate retroactively with respect to outstanding licenses or permits where vested rights are not involved. However, an ordinance cannot operate retroactively to divest property rights that have accrued by virtue of substantial work done, expenditures made, or obligations incurred in reliance on a license or permit.
In the present case there is no provision of exception or reservation as to existing licenses. In fact, under the new ordinance these licenses are saved. Section 12 provides that all licenses issued under the prior licensing ordinance shall *94 continue in force and effect until their termination date, after which application for renewal licenses shall be made. Furthermore, it was conceded at the second oral argument of this matter that the holders of these licenses had acquired certain property rights which could not be divested.
An ordinance is presumed to be constitutional and valid until declared otherwise by the court. Hasbrouck Heights Hospital Ass'n v. Borough of Hasbrouck Heights, 15 N.J. 447 (1952); Kozesnik v. Montgomery Tp., 24 N.J. 154, 167 (1957); Moyant v. Borough of Paramus, 30 N.J. 528, 574 (1959); Local Board of Health, Berkeley Tp. v. Johnson, 73 N.J. Super. 384, 391, 392 (App. Div. 1962). In fact, there must be compelling evidence to overcome the presumption of validity that attaches to a municipal ordinance. City of Clifton v. Weber, 84 N.J. Super. 333, 339 (App. Div. 1964), affirmed 44 N.J. 266 (1965).
Under the circumstances, should licenses issued under an ordinance that is presumed to be valid, and while the presumption of validity exists, be revoked because the ordinance was declared unconstitutional at a later date?
This question has been answered adequately in Lang v. City of Bayonne, 74 N.J.L. 455 (E. & A 1906):
"I am unable to accept as sound the doctrine upon which it is rested, namely, that an unconstitutional law is void ab initio and affords no protection for acts done under its sanction. That it works injustice in its application to the citizen is apparent. The Flaucher case [Flaucher v. Camden, 56 N.J.L. 244] is a pregnant example of the truth of this assertion. The legislature had enacted a general law, making the unlicensed sales of intoxicating liquor a criminal offense, but legalizing such sales when made by a person holding a license from the proper authority. It then, by a subsequent statute, created the county board of license commissioners the proper authority to grant such licenses in the county of Camden. Flaucher applied to, and received from, this board a license to sell liquors at his saloon in the city of Camden. At that time the law creating the county board stood upon the statute book, apparently as valid, as much entitled to be respected and obeyed as the enactment which prohibited the sale of liquor without a license. And yet, notwithstanding that he scrupulously observed the law, as declared by the legislature, he was made a criminal by judicial decision, a decision *95 which in its operation and effect was as much ex post facto as any statute which makes criminal an antecedent act which violated no law at the time when it was done.
The vice of the doctrine of Norton v. Shelby County [118 U.S. 425, 6 S.Ct. 1121, 30 L.Ed. 178] as it seems to me, is that it fails to recognize the right of the citizen, which is to accept the law as it is written, and not to be required to determine its validity. The latter is no more the function of the citizen than is the making of the law. Each of these functions has been delegated by the constitution, the one to the judicial and the other to the legislative branch of the government. And it is to be observed that the judicial function of determining the validity of statutes is confined within a very narrow scope. Courts are not vested with the general supervision of legislation. They have received no authority from the people to inspect each statute, as it comes from the hands of the legislature, and declare whether or not it infringes constitutional limitations. The function of the judicial department with respect to legislation deemed unconstitutional is not exercised in rem, but always in personam. Allison v. Corker, 38 Vroom 596 [67 N.J.L. 601].
To require the citizen to determine for himself, at his peril, to what extent, if at all, the legislature has overstepped the boundaries defined by the constitution in passing this mass of statutes would be to place upon him an intolerable burden, one which it would be absolutely impossible for him to bear  a duty infinitely beyond his ability to perform. In my opinion the provisions of a solemn act of the legislature, so long as it has not received judicial condemnation, are as binding upon the citizen as is the judgment of a court rendered against him so long as it remains unreversed." (at pp. 459-460)
Furthermore, while it has often been stated in general terms that an unconstitutional statute confers no rights, creates no liability and affords no protection, there are many well recognized exceptions to this general rule. An unconstitutional law should not be applied to work a hardship or impose a liability on one who has acted in good faith and relied on the validity of a statute before the courts have declared it invalid. Allen v. Holbrook, 103 Utah 319, 135 P.2d 242 (Sup. Ct. 1943); State v. Village of Garden City, 74 Idaho 513, 265 P.2d 328 (Sup. Ct. 1953).
Courts have also held that equitable rights may be acquired though the statute is thereafter declared unconstitutional. Flournoy v. First National Bank of Shreveport, 197 La. 1067, 3 So.2d 244 (Sup. Ct. 1941); Chicot County *96 Drainage District v. Baxter State Bank, 308 U.S. 371, 60 S.Ct. 317, 84 L.Ed. 329 (1940); Missouri Utilities Co. v. City of California, 8 F. Supp. 454 (D. Ct. 1930), appeal dismissed 79 F.2d 1003 (8 Cir. 1935); Miller v. Dunn, 72 Cal. 462, 14 P. 27 (Sup. Ct. 1887); Wichita County v. Robinson, 155 Tex. 1, 276 S.W.2d 509 (Sup. Ct. 1954).
Thus, the effect of the new ordinance is to "save" the licenses now outstanding until their termination dates, but it does not require that new applicants or renewal applicants in the future be residents of Elizabeth. However, after the termination dates of all licenses now in effect, the total amount of new licenses and renewal licenses shall not exceed in number the limitations set out in section 7 of ordinance No. 260.

IV
Plaintiffs contend that the ordinance in question is void for the further reason that it is for the purpose of raising revenue and that the fees sought to be exacted are such as reveal their confiscatory nature. This court cannot agree that the ordinance is invalid merely because one of its functions is to raise revenue.
N.J.S.A. 40:52-2 states that:
"The governing body may fix the fees for all such licenses, which may be imposed for revenue, and may prohibit all unlicensed persons and places and vehicles, businesses and occupations from acting, being used, conducted or carried on; impose penalties for violation of ordinances providing for licenses, and revoke any license for sufficient cause and after notice and hearing."
In Salomon v. Jersey City, 12 N.J. 379 (1953), the court stated:
"In the light of all of the foregoing, we consider that the primary and overriding purpose of the Legislature in enacting R.S. 40:52-1 and R.S. 40:52-2 was to authorize municipalities to license and regulate, as police measures for the public health, safety, morals or welfare, the local businesses described therein, and only incidentally *97 to impose on the businesses thus licensed and regulated license fees for revenue which may, at least within reasonable limits, exceed the regulatory costs."
The following cases are illustrative of the liberal constructions rendered by the courts, whereby it has been held that municipalities have, under their general power to regulate, the power to levy license fees in part for revenue.
In Tayloe v. City of Wahpeton, 62 N.W.2d 31 (N.D. Sup. Ct. 1953), plaintiff sought to enjoin the city from enforcing an ordinance purporting to regulate and control the collection of garbage within the city. The District Court sustained a demurrer to the complaint and the Supreme Court, in affirming the decision, stated that in determining whether such an ordinance is a welfare, rather than a revenue measure, the test is "whether it has some relation to the public welfare, and whether such is in fact the end sought to be attained." The Court further stated:
"Ordinance providing for the collection and disposal of garbage was a welfare measure for the protection of public health, and not a measure for raising revenue, and fact that * * * city derived some revenue from the measure, did not change status of ordinance to that of a revenue measure." (Emphasis added)
In Jacobs v. Mayor, etc., of Baltimore, 172 Md. 350, 191 A. 421 (Ct. App. 1937), the sale and delivery of coal was regulated by license. The ordinance was held not to have been a revenue measure, but rather a regulatory measure. It is pertinent to note that the court said that the grant of power to the municipality is broad and comprehensive, and that there can be no question it possesses the corporate capacity to provide by ordinance for licensing and regulation of all kinds of business. The authority to impose a license fee may be employed as a regulatory measure or to produce revenue.
9 McQuillin, Municipal Corporations (3d ed.) sec. 26.30, p. 70, states that the view has been taken that authority to impose a license fee is authority to employ such a fee *98 either as a regulatory measure or to produce revenue. Nor does the fact that a license ordinance incidentally raises revenue affect its validity.
Gilbert v. Town of Irvington, supra, was an action contesting the validity of an ordinance establishing a license fee for coin-operated milk vending machines. The court held the ordinance void, but laid down a principle which should well be followed here. The court stated:
"* * * the license fee required by the duly enacted ordinance of the Town of Irvington is entitled to a presumption of reasonableness and the burden of proving otherwise rests with the plaintiffs." (at p. 435)
That being so, this court cannot agree with plaintiffs that Elizabeth is without the power to have enacted the ordinance in question.
Section 4 of ordinance No. 260 provides as follows:
"Before a license is issued for any of the coin operated devices covered by this ordinance, the applicant for such license shall first apply for and obtain an operator's license, the fee for which shall be (a) in the case of music machines, the sum of Two Hundred ($200.00) Dollars per year for an operator licensing and operating more than one (1) music machine, and a fee of One Hundred ($100.00) Dollars for an operator licensing and operating only one (1) music machine, and (b) in the case of all other types of amusement and entertainment machines or devices, the sum of Two Thousand ($2,000.00) Dollars per year."
There is little question in this court's mind that the fees sought to be exacted are reasonable and commensurate with the power of the city to regulate the business of juke boxes and to acquire revenue therefrom.
Olan Mills Inc. of Ohio v. Board of Commissioners, of City of Trenton, 40 N.J. Super. 168 (Law Div. 1956), involved an attack by plaintiff upon the validity of an ordinance imposing a license fee on itinerant photographers. The court held that it was unreasonable to subject plaintiff to a greater *99 license fee simply because it sent its negatives to an out-of-State location for developing. With regard to another contention of plaintiff, however, the court stated:
"Inasmuch as the license fee of $300 is imposed not only for purposes of regulation but also for revenue as stated in Ordinance 884, and as permitted by statute (R.S. 40:52-2), I cannot say that the fee is so excessive as to justify the conclusion that it is unreasonable, prohibitory or confiscatory. * * *
Furthermore, there is a presumption that the fee is reasonable in amount and the burden of showing to the contrary rests upon him who challenges it. I find that plaintiff has failed to carry that burden." (Emphasis added).
This court has not been shown that the license fees set out in the Elizabeth ordinance are unreasonable, confiscatory or exorbitant. In view of the authorities cited supra, this court is of the opinion that said fees are reasonable ones and are reasonably justified by the purposes for which the ordinance was enacted.

V
Plaintiff Dierickx Music, Inc. contends that the reversal of the conviction in the case of State v. Dierickx Vending Co. in the Union County Court (Docket No. 930), has the same effect as a mandamus to the extent that the city was required to issue licenses forthwith. That case resulted in the reversal of two convictions obtained in Elizabeth Municipal Court for violation of section 2, paragraph 1 of an ordinance entitled: "To Provide for the Licensing and Regulation of Coin Operated Music Machines." In a letter opinion dated December 8, 1966 this court held the residency requirement of the ordinance to be invalid and reversed because the evidence disclosed that the residency clause was the basis for the denial of the license application. The judgment reversing the convictions was entered by the court on January 6, 1967. Prior to the entry of that judgment ordinance No. 260 was introduced and passed on first reading on December 27, 1966.
*100 Mandamus is defined in Bouvier's Law Dictionary as an "extraordinary remedy in cases where the usual and ordinary modes or proceedings are powerless to afford remedies to the parties aggrieved, and when, without its aid, there would be a failure of justice." The question here is: What effect did the judgment of January 6, 1967 have?
Writs of mandamus and all other prerogative writs have been superseded by New Jersey Constitution (1947), Art. VI, sec. V, par. 4, which provides that "in lieu thereof, review, hearing and relief shall be afforded in the Superior Court, on terms and in the manner provided by rules of the Supreme Court as of right, except in criminal causes where such review shall be discretionary." In Nolan v. Fitzpatrick, 9 N.J. 477 (1952), it was held that the Supreme Court's primary objective, in exercising the jurisdiction so conferred by providing, through rules of court, for proceedings in lieu of prerogative writs, was to safeguard individual rights against public officials and governmental bodies while at the same time avoiding defects of procedure that had led to criticism.
Thus, a procedure does exist for reviewing the action of a license inspector in refusing to grant a license or permit to one entitled to it. The jurisdiction for a proceeding in lieu of prerogative writs is in the Superior Court. A reversal of a conviction on an appeal from a municipal court cannot operate as a mandamus to compel the issuance of a liecnse or permit forthwith.
The ordinance in effect on the date of the hearing of this proceeding in lieu of prerogative writs governs the proceeding except with respect to rights that have vested under the ordinance existing prior to the hearing. See Socony-Vacuum Oil Company, Inc. v. Mt. Holly Tp., 135 N.J.L. 112 (Sup. Ct. 1947). That case raises the question of whether plaintiff was entitled to a writ of mandamus compelling the township to issue a building permit for construction of a gasoline service station. A zoning ordinance was passed putting the property in question in a residential zone. Plaintiff based its claim on the assertion that it was *101 the law prevailing at the time it applied for the permit or at the time it obtained the rule to show cause that controlled. There was no zoning in effect at either time. The township contended that the law at the time of determination of the case was controlling. The court said:
"Moreover, in my opinion, there can no longer be any question as of the time when the status of the applicable law controls. It is neither the status of the law prevailing at the time of the application for the permit nor the status of the law prevailing at the time of the application or allowance of the rule to show cause. It is the status of the law prevailing at the time of the decision by the court that is controlling. [Citation omitted]
And just as a change in the law between a nisi prius and an appellate decision requires the appellate court to apply the changed law, so, by like token, a change of law pending an administrative hearing or act must be followed in relation, as here, to a permit for the doing of a future act. Otherwise the administrative body, here the building inspector whose acts are subject to appeal to or review by this court, would issue a permit contrary to the existing legislation. [Citation omitted]
While the power to issue a writ of mandamus is, as frequently stated by our courts, a discretionary power, the exercise of that power is governed and controlled by well established principles. The discretionary power must not be arbitrarily or capriciously exercised. It must be judicially exercised. * * *" (at p. 117)
In the present action by Dierickx Music, Inc., there is no dispute about the fact that ordinance No. 260 is in effect on the date of this hearing. The ordinance is therefore controlling except with respect to any rights that may have vested in plaintiff under the law existing prior to the hearing. There is no dispute about the fact that no license has ever been issued to plaintiff under the ordinance or the prior ordinance. Plaintiff, therefore, does not have the vested rights of the holder of a license duly issued under an earlier ordinance. State v. Dierickx Vending Company was an appeal from convictions in Elizabeth Municipal Court. No proceeding prior to this one was ever instituted by plaintiff to compel the license inspector of Elizabeth to issue a license to plaintiff.
*102 Plaintiff seeks to compel the issuance of a license on the basis of the fact that it made a prior application under an ordinance which did not limit the number of music machines permitted in Elizabeth. Its theory, apparently, is that since it made application under the prior ordinance it is entitled as of right to the issuance of a permit now, although the existing ordinance does not permit such issuance since the maximum number of licenses issued or renewable has already been exceeded.
In Rohrs v. Zabriskie, 102 N.J.L. 473 (Sup. Ct. 1926), plaintiff applied to defendant building inspector for a permit to erect a five-story apartment. The building inspector refused to issue the permit on the grounds that the zone prohibited such structure. The board of adjustment refused to modify the action of the building inspector. Thereafter the governing body of the municipality passed an amendment to the building ordinance and prohibited apartments of more than three stories anywhere in the municipality unless the apartment was of fireproof construction. Plaintiff brought an action to compel the issuance of the building permit on the basis that the application and review by the board of adjustment was made prior to the amendment to the building ordinance. The court held that the amendment was a valid exercise of police power, and it further held that the court would not issue a mandamus directing the municipality to grant a permit for erection of a building which was not permitted under the ordinance in effect on the date of the hearing.
In the present case the Elizabeth City Council his passed, and the mayor has signed, an ordinance which limits the number of licenses that can be issued for music machines. This court is bound by the terms of that ordinance.
Municipal ordinances are cloaked with a strong presumption of constitutionality. Roe v. Kervick, 42 N.J. 191, 229 (1964). One of the basic functions of government is to safeguard the health, safety and welfare of the people. Jones v. Haridor Realty Corp., 37 N.J. 384 (1962). The *103 wisdom of the Legislature as to the means it selects is not subject to review or interference by the courts except in the protection of fundamental constitutional rights. Gundaker Central Motors v. Gassert, 23 N.J. 71, 81 (1956). The judiciary does not pass upon the wisdom of a municipal ordinance nor does it nullify decisions of a governing body on the subject of local welfare merely because a debatable issue is presented. Fred v. Mayor, etc., of Old Tappan, supra.
In Marangi Bros. v. Board of Commissioners of Village of Ridgewood, 33 N.J. Super. 294, 301 (App. Div. 1954), the court said that in considering municipal measures designed to deal with problems of public health, under R.S. 40:48-2, N.J.S.A. 40:52-1(c) and R.S. 40:66-1, regard must be had for the presumptive validity already mentioned, and also for the doctrine that the governing body is entitled to wide latitude in its efforts at regulation; and that the enactment finally issued should not be disturbed unless palpably unreasonable or in conflict with some superior statutory or constitutional limitation. Dover Tp. v. Witt, supra, 7 N.J. Super. 259. And even more specifically here, in applying the various sections of the Home Rule Act, we must be mindful that the Legislature has directed a most liberal construction policy. R.S. 40:42-4 states that
"In construing the provisions of this subtitle, all courts shall construe the same most favorably to municipalities, it being the intention to give all municipalities to which this subtitle applies the fullest and most complete powers possible over the internal affairs of such municipalities for local self-government."
Nor can we lose sight of the mandate in the 1947 Constitution, Art. IV, sec. VII, par. 11, for liberal construction of legislation concerning municipal powers, as stated supra.
For the reasons set out above, the complaints will be dismissed and judgments entered for defendants.
