
374 S.E.2d 272 (1988)
323 N.C. 598
In the Matter of LYNETTE H., a minor child.
No. 252PA88.
Supreme Court of North Carolina.
December 8, 1988.
*273 Lacy H. Thornburg, Atty. Gen. by Wilson Hayman, Asst. Atty. Gen., Raleigh, for the State, appellant.
Elisabeth P. Clary, Raleigh, for respondent-appellee.
Sumner & Hewes by William E. Sumner and David A. Webster, Atlanta, Ga., and Roberts Stevens & Cogburn, P.A. by William Clarke and Glenn S. Gentry, Asheville, for Highland Clinic, amicus curiae.
Hunton & Williams by Christopher G. Browning, Jr., Raleigh, for North Carolina Civil Liberties Union Legal Foundation, amicus curiae.
Deborah Greenblatt, Raleigh, for Carolina Legal Assistance, Inc., amicus curiae.
Abigail English, for Nat. Center for Youth Law, amicus curiae.
Albert J. Singer, Raleigh, for Durham Child Advocacy Com'n, amicus curiae.
Katherine S. Holliday, Charlotte, and Anna C. Stowe, Belmont, for Children's Law Center, amicus curiae.
Jordan, Price, Wall, Gray & Jones by William R. Shenton, Stephen R. Dolan and Steven Mansfield Shaber, Raleigh, for North Carolina Hosp. Ass'n, amicus curiae.
Adams, McCullough & Beard by Renee J. Montgomery, Raleigh, for North Carolina Charter Hospitals, amicus curiae.
Smith, Anderson, Blount, Dorsett, Mitchell & Jernigan by Julian D. Bobbitt, Jr. and Thomas B. Haller, Jr., Raleigh, for North Carolina Medical Soc., North Carolina Psychiatric Ass'n, North Carolina Psychological Ass'n, North Carolina Council of Child and Adolescent Psychiatry, North Carolina Alliance for the Mentally Ill, Nat. Ass'n of Social WorkersNorth Carolina Chapter, American Academy of Child and Adolescent Psychiatry, amicus curiae.
WHICHARD, Justice.
This is a special proceeding to determine whether the respondent, a minor, is mentally ill and in need of treatment. On 24 January 1987 respondent's parents requested her admission to Holly Hill Hospital, a mental health facility in Wake County (hereafter "the facility"), pursuant to N.C.G.S. § 122C-221 to -224, the statutes governing voluntary admission and discharge of minors from facilities for the mentally ill. A qualified physician determined that respondent suffered from a mental illness and was in need of treatment. She then was admitted to the facility on a temporary basis at the request of her parents. Admission at the request of a minor's parents is a voluntary admission under N.C.G.S. § 122C-221.
On 27 January 1987, within the required ten day period, the District Court, Wake County, held a hearing to determine whether the minor respondent was mentally ill and in need of further treatment at the facility. N.C.G.S. § 122C-223 (1986). The court found that the evidence presented at the hearing did not support a finding of mental illness as defined in N.C.G.S. § 122C-3(21). It specifically ruled in open court as follows: "After a full hearing, this Court finds as a fact that the Respondent is not suffering from a mental condition as defined by Section 122C-3(22) [sic]." The court stated: "I will find that that [i.e., respondent's behavior depicted by the evidence] does not constitute any type of ... is not due to a mental condition." The State did not enter notice of appeal, either by oral notice at the hearing or by written notice filed within ten days thereof. See N.C.G.S. § 1-279 (1983); N.C.R.App.P. 3.
On 6 August 1987, over six months following the hearing, the trial court signed a *274 document entitled "Memorandum Opinion and Order." A notation on the order, following the 6 August 1987 date and apparently in the trial judge's handwriting, states: "Nunc pro tunc Jan. 28, 1987." This order declares that the statutory definition of mental illness as applied to minors, N.C.G.S. § 122C-3(21)(ii),[1] "must fail for vagueness." It recites that the statute "fails to give ... a standard that protects against arbitrary and discriminatory action." It further recites: "Minors would therefore be treated differently depending on the draw of the Judge or, for that matter, the attending physician. Such probability is inherently unfair." The State entered notice of appeal from the 6 August 1987 order.
On appeal, the Court of Appeals affirmed the order. In re Lynette H., 90 N.C.App. 373, 368 S.E.2d 452 (1988). The State entered notice of appeal, pursuant to N.C.G.S. § 7A-30(1), on the ground that the decision of the Court of Appeals involves a substantial constitutional question. It simultaneously petitioned for discretionary review. On 28 July 1988 we allowed discretionary review. For reasons that follow, we now vacate the opinion of the Court of Appeals and remand the case to that court with instructions to vacate the 6 August 1987 order.
As noted, on 27 January 1987 the trial court ruled in open court that respondent was not mentally ill within the meaning and intent of that term as used in N.C.G.S. § 122C-3(21)(ii). Upon that determination, respondent was entitled to be released from the facility.[2] N.C.G.S. § 122C-223(b) (1986) ("If the court finds that these requirements [i.e., mental illness and need for further treatment] have not been met, it shall order that the minor be released." (Emphasis added.)) The announcement of that determination in open court constituted entry of judgment for purposes of determining when notice of appeal had to be given, even if a formal written order was not filed until a later date. In re Moore, 306 N.C. 394, 400, 293 S.E.2d 127, 130-31, reh'g denied, 306 N.C. 565 (1982), appeal dismissed sub nom. Moore v. Guilford County Dept. of Social Services, 459 U.S. 1139, 103 S.Ct. 776, 74 L.Ed.2d 987 (1983); Brooks, Com'r of Labor v. Gooden, 69 N.C.App. 701, 706, 318 S.E.2d 348, 352 (1984); N.C.G.S. § 1A-1, Rule 58 (1983). The State neither gave oral notice of appeal at the hearing nor filed a written notice of appeal within ten days following the ruling. By thus failing to give timely notice, the State lost its right to appealN.C.G.S. § 1-279 (1983); N.C.R. App. P. 3and the Court of Appeals had no jurisdiction to hear the case. "Failure to give timely notice of appeal in compliance with [N.C.] G.S. 1-279 and Rule 3 of the North Carolina Rules of Appellate Procedure is jurisdictional, and an untimely attempt to appeal must be dismissed." Booth v. Utica Mutual Ins. Co., 308 N.C. 187, 189, 301 S.E.2d 98, 99-100 (1983).
Further, the trial court's ruling that respondent was not mentally ill within the meaning and intent of the statute, announced in open court on 27 January 1987, concluded the case or controversy between the State and the respondent. As noted, upon that determination respondent was entitled to be released from the facility. N.C.G.S. § 122C-223 (1986). The court thus had no case or controversy before it and no jurisdiction to enter the subsequent order, on wholly different grounds from those announced in open court, declaring the statute unconstitutional.
*275 Because the court had concluded the case or controversy by finding the respondent not mentally ill, thus entitling her to release from the facility, the subsequent order was, in effect, a mere declaratory judgment on the constitutionality of the statute. "[T]his Court has held on a number of occasions that Courts have jurisdiction to render declaratory judgments only when the pleadings and evidence disclose the existence of an actual controversy between parties having adverse interests in the matter in dispute." Gaston Bd. of Realtors v. Harrison, 311 N.C. 230, 234, 316 S.E.2d 59, 61 (1984). "[A]n actual controversy [is] a `jurisdictional prerequisite' for a proceeding under the Declaratory Judgment Act.... [T]he ... Act does not `require the court to give a purely advisory opinion which the parties might, so to speak, put on ice to be used if and when occasion might arise.' " Id. at 234, 316 S.E.2d at 61-62 (quoting Tryon v. Power Co., 222 N.C. 200, 204, 22 S.E.2d 450, 453 (1942)). Having concluded the case or controversy by finding the respondent not mentally ill, the trial court lacked jurisdiction in this proceeding to declare N.C.G.S. § 122C-3(21)(ii) unconstitutional. Its order of 6 August 1987 thus should be vacated.
For the foregoing reasons, the opinion of the Court of Appeals is vacated. The cause is remanded to the Court of Appeals with instructions to vacate the 6 August 1987 order of the District Court, Wake County.
VACATED AND REMANDED.
NOTES
[1]  This statute provides:

"Mental illness" means: ... (ii) when applied to a minor, a mental condition, other than mental retardation alone, that so lessens or impairs the youth's capacity either to develop or exercise age appropriate or age adequate self-control, judgment, or initiative in the conduct of his activities and social relationships as to make it necessary or advisable for him to be under treatment, care, supervision, guidance, or control.
N.C.G.S. § 122C-3(21)(ii) (1986).
[2]  The record is not altogether clear as to whether respondent was in fact released at this time. The "Statement of the Proceedings" states that upon making the determination that the evidence did not support a finding of mental illness, the trial court "entered a verbal order discharging respondent from [the facility]." Counsel for the State stated in oral argument that respondent was in fact discharged at this time; counsel for respondent did not dispute this assertion.
