Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8518161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:54:20+00:00 2026-06-11T05:54:20+00:00

JLS 2.13.1 Interface Modifiers An interface cannot be final, because the implementation of such

  • 0

JLS 2.13.1 Interface Modifiers

An interface cannot be final, because the implementation of such a class could never be completed.

If I can write create static inner classes in interface I can provide implementation in it so why is such restriction

interface Type {

    // Normal
    class Value {
        private Value() {
        }

        public void print() {
            System.out.println("Test");
        }
    }

    public final Value value = new Value();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:54:22+00:00Added an answer on June 11, 2026 at 5:54 am

    BTW: nested classes were not available when this restriction was first defined, so really the question might be why this restriction was not lifted.


    A final class cannot have any sub-classes. It is considered best practice to only use interfaces for defining method(s) of sub-classes, so the two are contradictory.

    You can use interfaces for other things

    • annotations
    • javadocs
    • constants
    • defining nested classes only.

    but these are incidental to the purpose of an interface.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

on JLS 3, 17.5 Final Field Semantics's second discussion part: http://java.sun.com/docs/books/jls/third_edition/html/memory.html#17.5 It is said
This is from JLS 17.5: The usage model for final fields is a simple
Using QtWebkit's javascript bridge, I have created a class to interface the data in
Could someone help me understand section 15.12.2.5 of the JLS re: most specific method
Reading here: JLS 8.3.1.4 volatile Fields Without volatile it says then method two could
After I read JLS section 12.4.2 . 2.If the Class object for C indicates
When we create a CustomException by extending Exception class it is checked by compiler,
Here's a brief example from the JLS section 8.4.8.2. class Super { static String
I cannot easily find it in JLS/JVMSpec, nor in SO. I'm sure it must've
Is there a max length for class/method/variable names in Java? the JLS doesn't seem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.