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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:31:14+00:00 2026-05-11T13:31:14+00:00

Who is right? Eclipse or javac? ————— c/v/A.java ————— package c.v; public class A<T>

  • 0

Who is right? Eclipse or javac?

————— c/v/A.java —————

package c.v; public class A<T> { } 

————— c/v/B.java —————

package c.v; public class B extends A<B.Secret> {   private class Secret {}; } 

Eclipse compiles B.java just fine.

Javac has a problem.

$ javac c/v/B.java c/v/B.java:3: c.v.B.Secret has private access in c.v.B public class B extends A<B.Secret> {                            ^     1 error 
  • 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. 2026-05-11T13:31:15+00:00Added an answer on May 11, 2026 at 1:31 pm

    The relevant parts of the Java Language Specification must be:

    §8.1.4: […] The ClassType must name an accessible (§6.6) class type, or a compile-time error occurs.

    §6.6.1: […] A member (class, interface, field, or method) of a reference (class, interface, or array) type or a constructor of a class type is accessible only if the type is accessible and the member or constructor is declared to permit access:

    • If the member or constructor is declared public, then access is permitted. All members of interfaces are implicitly public. […]
      • Otherwise, if the member or constructor is declared private, then access is permitted if and only if it occurs within the body of the top level class (§7.6) that encloses the declaration of the member or constructor.

    So since the ClassType is not within the body of the class, B.Secret is not accessible at this location, so A<B.Secret> is not accesible, so a compile-time error should occur.

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

Sidebar

Ask A Question

Stats

  • Questions 103k
  • Answers 103k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer if you don't care which row gets deleted, use IGNORE:… May 11, 2026 at 8:24 pm
  • Editorial Team
    Editorial Team added an answer Your first thought was correct. Storing data in outside direcotry… May 11, 2026 at 8:24 pm
  • Editorial Team
    Editorial Team added an answer SELECT * FROM table1 WHERE ID NOT IN (SELECT *… May 11, 2026 at 8:24 pm

Related Questions

Who is right? Eclipse or javac? --------------- c/v/A.java --------------- package c.v; public class A<T>
When I'm online it seems that everyone has agreed that using the exclusive locking
I have a star schema type data base, with fact tables that have many
I want to get smarter in AJAX, but not sure which way to go.
I remember a discussion I recently had with a fellow developer about the memory

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.