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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:04:48+00:00 2026-06-05T16:04:48+00:00

I am reading about what an interface contains and I understand in addition to

  • 0

I am reading about what an interface contains and I understand in addition to the usual they can also contain inner classes or other interface.

Can anyone explain why or for what purpose anyone would want to put an interface inside an interface. Also why would anyone put an inner class inside. I have looked on the net but not found any good explanations other than a link that points to one of the standard java classes. What I really need to help me understand is a simple example.

  • 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-05T16:04:50+00:00Added an answer on June 5, 2026 at 4:04 pm

    Here’s an excerpt from an interface of mine that uses an inner class:

    public interface EmailService {
    
        void send(EmailDetails details);
    
        class EmailDetails {
            private String from;
            private List<String> to = Lists.newArrayList();
            private String messageTemplate;
            //...
        }
    }
    

    You see – the point is that the interface needs some additional definition (in this case – the parameter its method accepts). It would be the same thing with an inner interface.

    It could’ve been a separate class/interface, but as it is only relevant to this interface, I put it there.

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

Sidebar

Related Questions

I've been reading about dependency injection and have a simple question. I can understand
While reading about constant interface antipattern, i found final constant class with no instances
I was reading about SOLID and other design principles. I thought ISP was the
I am reading many posts about UIViewController managing but I can't find the solution
I recall reading about a broadcast receiver interface from the sync adapter or some
I've been reading about pros/cons of programming with/without an interface builder and i want
I've been reading about the OO 'fluent interface' approach in Java , JavaScript and
I was reading about Closure interface here: http://www.php.net/class.closure Then I googled it and couldn't
Reading about the Dispose pattern , I see the documentation repeatedly refer to cleaning
Reading about Kohana templates and saw something I've never seen before: $this->template->title = __('Welcome

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.