Identi.ca Identi.ca
  • Login
  • Public

    • Public
    • Groups
    • Featured
    • Popular

Conversation

Notices

  1. Gerard Ryan Gerard Ryan

    Hey #java, is it possible to import two classes with the same name, if they have different namespaces?

    about 10 months ago from Choqok
    • Laura Dragan Laura Dragan

      @grdryn yes :) but then when you use them you'll need to fully qualify them every time

      about 10 months ago
    • Gerard Ryan Gerard Ryan Laura Dragan

      @aprilush thanks! :) it seems having an import statement for both (fully qualified), will still clash - prob with good reason, seems odd tho

      about 10 months ago
    • Laura Dragan Laura Dragan

      @grdryn ah, it works if you import 1 of them & use the fully qualified name for the rest,or do not import any & just use the qualified names

      about 10 months ago
    • Laura Dragan Laura Dragan

      @grdryn now that i think of it it's not odd;import=telling java where to look for a class name,if the same name has 2 paths it gets confused

      about 10 months ago
    • Gerard Ryan Gerard Ryan Laura Dragan

      @aprilush makes sense now, thanks! :) Reason I was importing both: one was renamed to have same name as other, so I renamed the import

      about 10 months ago
    • Gerard Ryan Gerard Ryan Laura Dragan

      @aprilush it felt odd for me because I had both fully qualified everywhere in the code but the imports were still clashing

      about 10 months ago
    • Gerard Ryan Gerard Ryan Laura Dragan

      @aprilush I guess it's also a good thing because when it errors, it reminds people to qualify one. 'import someclass as sc' might be nice :)

      about 10 months ago
    • Laura Dragan Laura Dragan

      @grdryn others want it too :) http://mail.openjdk.java.net/pipermail/coin-dev/2009-March/000069.html

      about 10 months ago
      Gerard Ryan likes this.
    • Laura Dragan Laura Dragan

      @grdryn if both have the same importance, it's better to not import any, just use the qnames; otherwise, import the one which is most used

      about 10 months ago
      Gerard Ryan likes this.

Site notice

Identi.ca is converting to pump.io on 1 June 2013

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

Identi.ca is a microblogging service brought to you by E14N. It runs the StatusNet microblogging software, version 1.1.0-release, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Identi.ca content and data are available under the Creative Commons Attribution 3.0 license.

Switch to mobile site layout.

Built in Montreal