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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:19:35+00:00 2026-06-02T00:19:35+00:00

a.java has import java.io.*; I dragged all the java to link to the project,

  • 0

a.java has import java.io.*; I dragged all the java to link to the project, but some ended up with red icon, while a.java with yellow. Those with red don’t have imports, and act like there are no imports, but that’s why I put a.java there. Why doesn’t it work?

  • 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-02T00:19:36+00:00Added an answer on June 2, 2026 at 12:19 am

    Just because A.java has import java.io.*; it doesn’t mean that B.java has access to java.io.*;. B.java will have to import what it wants to use explicitly, even if they are in the same package.
    This is specified in §6.3 and §7.5 of the JLS.

    From section 6.3:

    An import declaration makes types or members available by their simple names only within the compilation unit that actually contains the import declaration. The scope of the type(s) or member(s) introduced by an import declaration specifically does not include the PackageName of a package declaration, other import declarations in the current compilation unit, or other compilation units in the same package.

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

Sidebar

Related Questions

Does java has library exception class which means actually not an error, but good
Which static analysis tools for Java has easiest extension mechanism. I checked PMD But
Does such a thing exist anywhere? Basically I see java has LinkedHashSet but no
I am using java 6 and rt.jar has all the classes required to do
I need to know how applicatoncontextaware works. I have applicationContext.xml which has some import
I'm using cuke4duke in a grails project. The features/support/env.groovy has import org.openqa.selenium.htmlunit.HtmlUnitDriver import org.openqa.selenium.JavascriptExecutor
Java has compiler checked exceptions . When I made transition to C++, I learned
C++ has std::vector and Java has ArrayList , and many other languages have their
Has Java always maintained source-code backward compatibility during its development? More precisely: given two
My Java application has got a package structure similar to this: src/com/name/app src/com/name/app/do src/com/name/utils/db

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.