--- id: java-constants-final title: "Java Constants Final" category: "Programming_Language" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["final keyword", "μžλ°” μƒμˆ˜"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.9 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["java", "programming", "w3schools", "final", "constants"] raw_sources: ["https://www.w3schools.com/java/java_variables_final.asp"] applied_in: [] github_commit: "" --- # [[Java Constants Final]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) `final` variables are conventionally written in UPPER_CASE (e.g. `BIRTHYEAR`) β€” a style-only convention, not enforced by the compiler, but a strong readability signal that a value is a true constant. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **`final` keyword** β€” makes a variable a constant: unchangeable and read-only. [S1] - **Reassignment error** β€” attempting to change a final variable raises a compile error. [S1] - **When to use** β€” for values that should never change (minutes per hour, a birth year). [S1] - **Naming convention** β€” final variables are usually written in UPPER_CASE (not enforced, just convention). [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Basic final: `final int myNum = 15; myNum = 20; // Error`. [S1] - Named constants: `final int MINUTES_PER_HOUR = 60; final int BIRTHYEAR = 1980;`. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) μ†ŒμŠ€μ—μ„œ λͺ¨μˆœλ˜λŠ” μ •λ³΄λŠ” λ°œκ²¬λ˜μ§€ μ•ŠμŒ. ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” μ ˆλŒ€ λ³€κ²½λ˜μ§€ μ•Šμ•„μ•Ό ν•˜λŠ” κ°’(μ„€μ •κ°’, 물리 μƒμˆ˜ λ“±)에 ν‘œμ€€μ μœΌλ‘œ 쓰인닀. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Named constants with final (Java): ```java final int MINUTES_PER_HOUR = 60; final int BIRTHYEAR = 1980; ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.90 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[Java Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[Java Variables]], [[Java Modifiers]] - **μ°Έμ‘° λ§₯락:** λΆˆλ³€ 값을 κ°•μ œν•˜λŠ” ν‘œμ€€ 도ꡬ β€” Modifiers μ±•ν„°μ—μ„œ λ‹€λ₯Έ μ ‘κ·Ό μ œμ–΄μžμ™€ ν•¨κ»˜ 닀뀄진닀. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” Java Constants (final) β€” https://www.w3schools.com/java/java_variables_final.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "Java Constants (final)" page (Astra wiki-curation, P-Reinforce v3.1 format).