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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:06:57+00:00 2026-05-22T18:06:57+00:00

I have a Java library that I am working on with a directory structure

  • 0

I have a Java library that I am working on with a directory structure which looks like the following:

/com
  /example
    /LibX
      Server.java
      Client.java

Now, from a project which is using the above classes, it seems to me that importing com.example.LibX.* and using Client client = new Client(...); is a bit ambiguous, as “Client” could mean anything. Therefore, I tried the following, only to receive “package not found” errors:

import com.example.*;

LibX.Client client = new LibX.Client(...);

It is possible to do what I described? Or is there another way to remove the ambiguity without using com.example.LibX.Client?

  • 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-05-22T18:06:58+00:00Added an answer on May 22, 2026 at 6:06 pm

    Your concern about ambiguity is unnecessary – if you have an ambiguous reference your class won’t compile –
    e.g.

    import java.util.Date;
    import java.sql.Date;
    
    public class Test {
    
            private Date date;
    }
    

    won’t compile. So if you can compile the class then by definition you don’t have an ambiguous reference.

    Incidentally LibX.Client is a bit confusing. Usually classnames are capitalized, package names lowercased, so if you did that (if LibX was a top-level package and you were giving the full name) it looks more like an inner class reference, as in Andy’s response above.

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

Sidebar

Related Questions

I have a java library that I am accessing in VB.NET via COM. The
I have an existing library (JPhysX) that is a Java wrapper for a native
I find it funny that Java (or the java.util library) does not have a
I am working with a diff library in java that outputs diffs with square
Does Java have a built-in way to escape arbitrary text so that it can
Does Java have a data type that represents a period of time eg 34
I have a Java swing application with a panel that contains three JComboBoxe s
I am working on a Java project that I want to deliver to my
I am working on a legacy Java Enterprise server project, and currently I am
I have a view defined in SQL server 2008 that joins 4 tables together.

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.