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

  • Home
  • SEARCH
  • 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 7986095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:45:04+00:00 2026-06-04T11:45:04+00:00

I was building a class using play framework 1.2.x . I have a Controller

  • 0

I was building a class using play framework 1.2.x .

I have a Controller class which contains a non-anonymous(named) private inner class.

When I try to access one of the public fields of the inner class via its constructor I get the following error NonAnonymous Inner class access exception

The above code

private static class FinancialTransactionJSONPacket implements JSONPacket{
    public final boolean isSuccess;
    public final List<FinancialTransaction> financialTransactions;
    public final  OPERATIONS operation;

    public FinancialTransactionJSONPacket(boolean isSuccess,FinancialTransaction financialTransaction,OPERATIONS operation) {           
        this(isSuccess,new ArrayList<FinancialTransaction>(),operation);
/* Line 43 */   this.financialTransactions.add(financialTransaction);           
    }
}

I don’t get the Logic , how is this even possible ? I am accessing an attribute of a class from within its constructor how do access specifiers matter ?

I tried searching and found this article but it relates to anonymous Inner Classes, and the solution proposed is to make the anonymous inner class as a named class.

Declarations

  • public final List<FinancialTransaction> financialTransactions;
  • private static class FinancialTransactionJSONPacket
  • 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-04T11:45:05+00:00Added an answer on June 4, 2026 at 11:45 am

    The static class is private, so only the enclosing class can access its members, whether they are public or not.

    I can’t see any evidence in your illegible graphic that the access is happening within the static class’s own constructor. It looks when I peer at it more like an external class is trying to access the class’s innards.

    NB This is not an inner class, because it is static.

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

Sidebar

Related Questions

I am building a project using the Play framework and I am having trouble
I am building an Class Library application which contains some reference dlls like Skype4COM
I have class named Building : @interface Building : NSObject @property (nonatomic,retain)NSString* node; @property
I'm building a C# class library, and using the beta 2 of Visual Web
Using c# 4.0 -- building an interface and a class that implements the interface.
I am building a class which subclasses dict , and overrides __setitem__ . I
I am building a class library and using its default namespace as System. There
I'm currently building a class in PHP that generates PDF documents using the WKHTMLTOPDF
When building a class in CoffeeScript, should all the instance method be defined using
I'm currently building a class using TDD. The class is responsible for waiting for

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.