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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:36:48+00:00 2026-06-16T05:36:48+00:00

I came across the expression ‘subclasses of the containing class’ when I read a

  • 0

I came across the expression ‘subclasses of the containing class’ when I read a paper. What does that containing class mean in Java? This is the excerpt from the paper.

Primarily, this entailed three things: (i) studying the implementation of the entity, as well as its usage, to reason about the intent behind the functionality; (ii) performing static dependency analysis on the entity, and any other types, methods, or fields referenced by it, including constants; and (iii) examining the inheritance hierarchy and subclasses of the containing class. This approach took considerable time and effort to apply.

  • 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-16T05:36:49+00:00Added an answer on June 16, 2026 at 5:36 am

    This example has a subclass of the containing class:

    class Parent {
        class Child {
        }
    }
    
    class ParentSubclass extends Parent {
        void whatever() {
            new Child(); // Creates an instance of Parent.Child
        }
    }
    

    ParentSubclass is a subclass of the containing class of Child. Note that outside of Parent (or its subclasses), new Child() will not work, as you need to have a containing (“outer”) class to instantiate a non-static “inner” class.

    Things get a bit crazy when you now add a method doSomething to Parent, invoke it in Child but override it in ParentSubclass.

    class Parent {
        void doSomething() {
            System.out.println("Not doing anything");
        }
    
        class Child {
            void whatever() {
                doSomething(); // actually: Parent.this.doSomething()
            }
        }
    }
    
    class ParentSubclass extends Parent {
        void doSomething() {
            System.out.println("I'm just slacking.");
        }
    
        void whatever() {
            Child a = new Child(); // Creates an instance of Parent.Child
            a.whatever(); // will print "I'm just slacking".
        }
    }
    

    Situations like this make static code analysis a quite hard problem.

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

Sidebar

Related Questions

Sorry for this english related question but I only came across that expression in
I came across an interesting question on java regex Is there a regular expression
I came across $$ expression in shell script, something like this TFILE=$$ Can anyone
I'm working on a web site with Expression Web. I came across this website
A while back I came across a ruby gem that, given a regular expression,
I came across this expression ${varname:-text},And 3 other similar forms: ${varname-text} ${varname:=text} ${varname:?text} It
Recently I came across this Perl expression on a blog, unable to grab it
I recently came across this expression - but reading up on Wikipedia did not
Came across this handy regular expression utility in Python (I am a beginner in
I came across an interesting expression in Ruby: a ||= new It means that

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.