OPINION
MATTHEWS, Justice.This case involves a constitutional challenge to AS 22.25.011 requiring contribution by justices and judges to a retirement system. We find that the lower court erred in declaring the statute unconstitutional on equal protection grounds, and therefore reverse.
AS 22.25.011 states that “[e]ach justice and judge appointed after July 1, 1978, shall contribute seven per cent of the base annual salary received by the justice or judge to the judicial retirement system.”1 Justices and judges appointed prior to that date are not required to contribute, even though the criteria for eligibility (AS 22.25.-010) and the retirement pay (AS 22.25.020) are the same for both categories.
Superior court judge Karl Johnstone was appointed to the bench after July 1, 1978, and thus has seven per cent of his salary deducted as his contribution to the judicial retirement system. On August 7, 1980 he filed a complaint in superior court against William Hudson, the Commissioner of Administration, and the State of Alaska (hereinafter collectively referred to as “the state”). Judge Johnstone sought a declaratory judgment that AS 22.25.011 was unconstitutional and an injunction restraining the state from making further deductions under that statute.2
*1182On March 5,1981 the lower court entered summary judgment in favor of Judge John-stone. The basis for its decision was as follows:
It is declared that AS 22.25.011 is unconstitutional as a denial of equal protection under the law for it creates two separate classes of judges doing identical work and the first class appointed before July 1, 1978, can never be subject to the requirements of the statute even though they may commence new terms or new judicial positions after July 1, 1978.
The lower court directed the state to cease deducting seven per cent from Judge John-stone’s salary and further ordered it to return to him all amounts previously collected. It also awarded Judge Johnstone $1,500 in attorney’s fees. The state has appealed.
It is clear from the record below that had AS 22.25.011 read, “Each justice and judge commencing a new term of office after July 1,1978 shall contribute seven per cent,” the lower court would have found the statute constitutionally valid. Article IV, section 13 of the Alaska Constitution provides:
Justices, judges and members of the judicial council and the Commission on Judicial Qualifications shall receive compensation as prescribed by law. Compensation of justices and judges shall not be diminished during their terms of office, unless by general law applying to all salaried officers of the State.
(Emphasis added).
Were the legislature to implement a contributory judicial retirement system3 by exacting salary deductions from justices and judges “during their terms of office,” it would clearly run afoul of the compensation clause of article IV, section 13. Requiring a judge to contribute via a salary deduction to a retirement system diminishes a judge’s compensation. See Carper v. Stiftel, 384 A.2d 2, 6-7 (Del.1977); Wilson v. Marsh, 162 Neb. 237, 75 N.W.2d 723, 730 (Neb. 1956). If there is to be a contributory retirement system, exempting justices and judges already in office from the duty of contribution during their terms of office would therefore be constitutionally compelled by article IV, section 13.
Institution of a contributory retirement system, rather than one which is noncontributory, will substantially further a legitimate economizing purpose. Since no suspect classifications or fundamental rights are involved, AS 22.25.011 does not violate either the federal or the state equal protection clauses. See Rose v. Commercial Fisheries Entry Commission, 647 P.2d 154, 158-59 (Alaska 1982); Pharr v. Fairbanks North Star Borough, 638 P.2d 666, 669-70 (Alaska 1981). Differences in compensation between otherwise similarly situated judges which result from a state’s compensation clause have readily withstood federal equal protection scrutiny. See Kavanagh v. Brown, 206 F.Supp. 479, 482-85 (E.D.Mich.), aff’d per curiam, 371 U.S. 35, 83 S.Ct. 143, 9 L.Ed.2d 112 (1962); Taylor v. State, 360 Mich. 146, 103 N.W.2d 769, 773-74 (Mich. 1960); Shubat v. State, 157 Mont. 143, 484 P.2d 278, 284-86 (Mont.1971). Furthermore, if the disparate treatment occasioned by AS 22.25.011 is mandated by article IV, section 13 of the Alaska Constitution, a state equal protection challenge will similarly be of no avail. Cf. Park v. State, 528 P.2d 785, 786-87 (Alaska 1974) (“It is a well accepted principle of judicial construction that whenever reasonably possible, every provision of the Constitution should be given meaning and effect, and related provisions should be harmonized”).
AS 22.25.011 states, however, that justices and judges “appointed ” after July 1, 1978 must contribute. As is evident from the trial court’s memorandum of decision, it is the legislature’s use of that word which the court found repugnant. The lower court reasoned that since justices and judges appointed prior to July 1,1978 “may *1183commence new terms” after that date, article IV, section 13 does not require that the legislature forever exempt such justices and judges from having to contribute to the retirement system. The lower court obviously construed the phrase “terms of office” in article IV, section 13 as referring to the ten year and six year intervals between retention elections for justices and judges, respectively, established by article IV, section 6 of the Alaska Constitution.4 Judge Johnstone argues that this is the proper construction of that phrase. The state, on the other hand, maintains that for purposes of article IV, section 13 justices and judges serve a single term of office until rejected by the electorate.
Before addressing this issue, we think it appropriate to note that its resolution is, indirectly at least, of financial interest to the members of this court. For example, were we to construe the phrase “terms of office” in article IV, section 13 as urged by Judge Johnstone, and hold AS 22.25.011 unconstitutional, it is conceivable that the legislature might enact a statute requiring justices and judges presently on the bench to contribute to the retirement system upon gaining approval at their next retention election. The existence of such a financial interest calls into question the propriety of this court deciding the case. See Code of Judicial Conduct, Canon 3(C)(1). While article IV, section 16 of the Alaska Constitution confers authority on the Chief Justice to “assign judges from one court or division thereof to another for temporary service,” all such judges likewise have a financial interest in the outcome of this case.
Fortunately, this dilemma has been dealt with before. In cases such as this, the law recognizes that it may become necessary for a court to render a decision notwithstanding that the court has a financial interest in the matter. See, e.g., United States v. Will, 449 U.S. 200, 213-16, 101 S.Ct. 471, 480-81, 66 L.Ed.2d 392, 405-06 (1980); Atkins v. United States, 556 F.2d 1028, 1035-40 (Ct.C1.1977); Olson v. Cory, 27 Cal.3d 203, 164 Cal.Rptr. 217, 220, 609 P.2d 991, 994 (Cal.1980). Under the rule of necessity “a judge is not disqualified to try a case because of his personal interest in the matter at issue if there is no other judge available to hear and decide the case.” Atkins v. United States, 556 F.2d at 1036. To hold otherwise “would result in a denial of a litigant’s constitutional right to have a question, properly presented to such court, adjudicated.” State ex rel. Mitchell v. Sage Stores Co., 157 Kan. 622, 143 P.2d 652, 656 (Kan.1943) (quoted with approval in United States v. Will, 449 U.S. at 214, 101 S.Ct. at 480, 66 L.Ed.2d at 405). The rule of necessity is applied in cases where “[t]o disqualify one would disqualify all.... ” Olson v. Cory, 164 Cal.Rptr. at 220, 609 P.2d at 994. That being the situation here, we conclude that this case is a proper one in which to invoke the rule.
Turning to the merits, both parties rely heavily on Buckalew v. Holloway, 604 P.2d 240 (Alaska 1979) in support of their respective positions concerning the meaning of “terms of office” for purposes of article IV, section 13. In that case the court was called upon to construe the meaning of the word “terms” as used in article IV, section 4 of the Alaska Constitution. That section states:
Supreme court justices and superior court judges shall be citizens of the United States and of the State, licensed to practice law in the State, and possessing any additional qualifications prescribed by law. Judges of other courts shall be selected in a manner, for terms, and with qualifications prescribed by law.
(Emphasis added). At issue was the validity of AS 22.15.170(c), which in pertinent part provides that “[e]ach magistrate serves *1184at the pleasure of the presiding judge of the superior court in the district for which appointed.” (Emphasis added). Holloway, a magistrate who had been terminated pursuant to this statute, claimed that “at the pleasure of” did not comport with the requirement of article IV, section 4 that “[jjudges of other courts shall be selected ... for terms ... prescribed by law.” According to Holloway, the word “terms” as used in that section referred to a period of service fixed in time. We disagreed, stating that: “[W]e do not believe it was intended to imply such a precise limitation. A broader definition of the word, ‘the time for which something lasts’ ... is in closer accord with the apparent purposes of article IV, section 4.” 604 P.2d at 244 (footnote omitted).
In reaching our decision in Buckalew, we did note in passing that article IV, section 6, governing judicial retention elections, “specifies the ‘terms’ of the justices and judges of the supreme and superior courts.” Id. According to Judge Johnstone, this statement is dispositive of the issue raised here. However, that sentence must be read in its proper context. For we went on to explain that “[t]he ‘terms’ thus delineated constituted a rejection of the federal judicial system, in which federal judges serve no ‘term’, but remain in office for life unless impeached.” Id. (footnote omitted). By no means were we purporting to say that the word “terms” for purposes of article IV, section 13 necessarily refers to the intervals between retention elections set forth in article IV, section 6. Indeed, we suggested that the word “terms” as used in article IV, section 13 had a different meaning:
As originally adopted, the constitution .. . used “term” generally to describe the period in office of all justices and judges, art. IV, § 13.
With the exception of art. IV, whereever “term” or “service at the pleasure of” appears in the constitutional text originally adopted ... the reference is to a period of service for a particular office, thus allowing the drafters to be precise, in their terminology. The language of art. IV, §§ 4 and 13, on the other hand, applies to any judge of any court the legislature might create, and “term” in that context may intend only the more general, though equally valid connotation of any limitation on a period of service. Cf. Webster’s Third New International Dictionary (1971) (“a limited or definite extent of time”); Black’s Law Dictionary (4th ed. 1968) (“the period during which elected officer or appointee is entitled to hold office”).
604 P.2d at 244 nn. 13, 14.
In our view, the phrase “terms of office” as used in article IV, section 13 means the period during which a justice or judge is entitled to hold office. Under our constitutional framework, a justice or judge commences office when appointed by the Governor to fill a vacancy. Alaska Const, art. IV, § 5. The office does not become vacant until “ninety days after the election at which he is rejected by a majority of those voting on the question, or for which he fails to file his declaration of candidacy to succeed himself.” Id. art. IV, § 7. Between such times the office is not vacant and the justice or judge appointed to the office is thus entitled to hold it.
’ To hold otherwise would, in our judgment, vitiate the proscription against diminishing the compensation of justices and judges during their terms of office. In discussing the compensation clause found in article III, section 1 of the federal constitution, the United States Supreme Court has noted:
The Compensation Clause has its roots in the longstanding Anglo-American tradition of an independent Judiciary. A Judiciary free from control by the Executive and the Legislature is essential if there is a right to have claims decided by judges who are free from potential domination by other branches of government .... Hamilton, in The Federalist No. 79, p. 491 (1818) (emphasis deleted), emphasized the importance of protecting judicial compensation:
*1185“In the general course of human nature, a power over a man’s subsistence amounts to a power over his will.”
United States v. Will, 449 U.S. 200, 217-18, 101 S.Ct. 471, 482, 66 L.Ed.2d 392, 407-08 (1980). That the drafters of Alaska’s constitution sought to insulate the judiciary from political pressure that might interfere with its impartiality is clear: “There is no doubt that judicial independence was a paramount concern of the delegates... . ” Buckalew v. Holloway, 604 P.2d 240, 245 (Alaska 1979) (footnote omitted); see 1 Proceedings of the Constitutional Convention 586-602. Were we to construe article IV, section 13 as urged by Judge Johnstone, the legislature could diminish a justice’s or judge’s compensation every ten or six years, respectively. Such a construction, we believe, would be contrary to the underlying purpose of the compensation clause.
Accordingly, we hold that justices and judges do not commence new “terms of office” for purposes of article IV, section 13 upon gaining the electorate’s approval in a retention election. It follows that the legislature, in implementing a contributory judicial retirement system, could not constitutionally require members of the judiciary already in office to contribute to such a system via a salary deduction. That being the case, the legislature’s use of the word “appointed” in AS 22.25.011 of necessity passes muster under equal protection. See, e.g., Kavanagh v. Brown, 206 F.Supp. 479, 482-85 (E.D.Mich.), aff’d per curiam, 371 U.S. 35, 83 S.Ct. 143, 9 L.Ed.2d 112 (1962). The lower court therefore erred in holding AS 22.25.011 unconstitutional on equal protection grounds.
Judge Johnstone also has argued that the judgment of the superior court can be affirmed on another ground. His argument is that AS 22.25.011 violates article XII, section 7 of the Alaska Constitution5 because the statutory requirement that judi-dal contributions be credited into the general fund rather than a separate account constitutes an impairment of accrued benefits. This argument has, however, been mooted by the 1982 amendments to AS 22.25.0116 and by related legislation establishing a judicial retirement system. AS 22.25.048.
The judgment of the superior court is REVERSED.
CONNOR, J., not participating.. AS 22.25.011 has been amended since this case was argued by Ch. 137, § 30, SLA 1982. It now reads, with 1982 additions underlined and deletions in brackets:
Each justice and judge appointed after July 1, 1978, shall contribute seven percent of the [HIS] base annual salary received by the justice or judge to the judicial retirement system. Contributions shall be made for all creditable service under this chapter to a maximum of 15 years. This contribution is made in the form of a deduction from compensation, and is made even if [NOTWITHSTANDING THAT] the compensation paid in cash to the justice or judge is reduced [THEREBY] below the minimum prescribed by law. Each justice and judge is considered to consent to the deduction [MADE] from [HIS] compensation. Payment of compensation less the deduction constitutes a full [AND COMPLETE] discharge [AND ACQUITTANCE] of all claims and demands for the services rendered by the justice or judge [HIM] during the period covered by the payment, except as to the benefits provided for under this chapter [AS 22.25.010-22.25.090]. The contributions shall be credited to the retirement fund established in accordance with AS 22.25.048 [INTO THE GENERAL FUND OF THE STATE],
The 1982 changes have no bearing on the equal protection issue raised in this case.
. The action was originally brought by Judge Johnstone and district court judge Richard Avery. Judge Avery has since resigned from the judiciary and is therefore no longer an active party in this case.
. That the state may validly implement a contributory judicial retirement system is clear. Alaska Const, art. IV, § 11 provides in relevant part:
Justices and judges shall be retired at the age of seventy except as provided in this article. The basis and amount of retirement pay shall be prescribed by law.
. Alaska Const, art. IV, § 6 provides:
Each supreme court justice and superior court judge shall, in the manner provided by law, be subject to approval or rejection on a nonpartisan ballot at the first general election held more than three years after his appointment. Thereafter, each supreme court justice shall be subject to approval or rejection in a like manner every tenth year, and each superior court judge, every sixth year.
. Art. XII, § 7 of the Alaska Constitution states:
Retirement Systems. Membership in employee retirement systems of the State or its political subdivisions shall constitute a contractual relationship. Accrued benefits of these systems shall not be diminished or impaired.
. See note 1 supra.