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 6955571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:45:13+00:00 2026-05-27T14:45:13+00:00

The Java Tutorial says that since an inner class is associated with an instance

  • 0

The Java Tutorial says that since an inner class is associated with an instance of the enclosing class, it (the inner class) cannot define any static members itself.

It’s interesting for me why can’t inner classes declare static members for instance, some private static field, which the instance of this inner class could possibly share with the other instances of the same inner class? is this just an implementation of things in Java that has to be taken for granted or something else?

  • 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-05-27T14:45:14+00:00Added an answer on May 27, 2026 at 2:45 pm

    Basically just an arbitrary decision. there’s no reason it couldn’t be supported, but there is also not really any good reason to support it. just declare the static field in the outer class.

    also, that quote may not be entirely correct: i believe you can declare a static serialVersionUID in an inner class.

    Update, sounds like this is now possible as of Java 16.

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

Sidebar

Related Questions

The Java Tutorial says that the static nested classes are accessed by using the
http://download.oracle.com/javase/tutorial/java/javaOO/nested.html says that static nested classes should be accessed this way: OuterClass.StaticNestedClass nestedObject =
Why this line doesn't work? import static java.nio.file.AccessMode.*; Eclipse says: The import java.nio.file cannot
The Java for C++ programmers tutorial says that (highlight is my own): The keyword
Is there any recommended Java application profiling tutorial? I am now using JProfiler and
Please provide a good, thorough tutorial about Java class loading , focusing on how
First off, rest assured that I've read every Oracle Java article & tutorial about
everything is the title java tutorial says: OuterClass.InnerClass innerObject = outerObject.new InnerClass(); this doesn't
I'm stuck on a portion of the Java tutorial, specifically this exercise . The
Please suggest a tutorial about java beans.

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.