Double import

I get an error when compiling a class that imports two class's with the same name but on diferent packages(I know... :P ).
Example :
import a.A;
import b.A;
public class XPTO {
a.A a;
b.A b;
     public XPTO(){
          a = new a.A();
b = new b.A();
But this 'ERROR' disapears if :
import a.*;
import b.*;
public class XPTO {
a.A a;
b.A b;
     public XPTO(){
          a = new a.A();
b = new b.A();
Is there a reason for such a compilation error? The Classes are explicitly indicated that they are diferent, throughtout the package, and evey call to each one is preceded by the package...
Compiled using the 1.4.Something
Thanx in advance,
Daniel Campelo

import is just a shorthand allowing you to not have to type in the fully-qualified name of a class. If you import a.A, then that means that the compiler can assume that class name A means a.A . When you explicitly import two classes with the same name, how is the compiler supposed to know which one you mean when you use A on it's own?
When using the star notation, the compiler is a bit more permissive. After all, there might be classes of the same name in the package which you aren't using. (java.awt.List, java.util.List). However, if you try to use A on its own
A a = new A();then the compiler will barf as before.
By the way, when posting code on these forums, enclose it in [ c o d e ] [ / c o d e] tags.

Similar Messages

  • IPhoto Slow, Blank thumbs, double import, did I mention S L O W

    iPhoto Slow, Blank thumbs, double import, did I mention S L O W? iMac G5, 768 Ram, I loaded and EDITED 500 photos, went to export. Found thousands of images in machine I never loaded. Attempted to export some photos to flickr (before finding they had a fix). Nothing.
    So I did, what any MS user would do, I reinstalled iPhoto. Now there are 500 empty frames, some with ghosts, and 2 sets of newly imported fotos. Tried to do some deleting, but no benefit.
    Any suggestions?

    Sorry to hear you're having problems like this - I have 768 MB of RAM on a G4, and I have seen no slowdown with 13,000+ photos.
    Could you be more specific with how you arrived at the problem? Here's some questions that come to mind:
    - What kind of images? JPG? RAW? approximately what size and resolution?
    - Blank thumbs are usually a result of things being moved around in the iPhoto library, and the iphoto database loses track of the paths. The golden rule is, never mess with the organization of your iPhoto library from within the Finder.
    - Usually if an application is that slow it is running into problems, so if you launch Console, and then iPhoto, you may see new messages that may indicate a problem.
    - The thousands of images in the machine, that you never loaded, what are they? Are they images that were in your Pictures folder? Did someone else use the computer?
    - What do you mean by double import? If you leave your camera or card reader connected, you will be shown the screen where iPhoto is ready to import. If you choose to import again, you could double-import.
    - If iPhoto finds photos at the root level of its iPhoto Library folder, it may try to import them. If interrupted or if the application is forced to abandon the import, it may try again on relaunch.
    - How did the export to flickr fail? Was it with the blank thumbnails selected?
    Maybe information that could answer the above questions, could help me or someone on the discussion board help you figure out what's going on.

  • Error : Double import : Connection

    Hi
    I Wanna use metadata connection as well as sql connection in a Javaclient , so I imported the java.sql.connection package and oracle.dss.*.mdmconnection .But Iam getting an error while compiling as follows Error :Double import : connection
    How can I access both metadata and RDBMS data from javaclient using a single connection.
    Jithesh

    Don't import one of them and use it fully qualified.
    i.e. don't import java.sql.Connection and then later do something like:
    java.sql.Connection c = DriverManager.getConnection(...);
    Hope this helps,
    Rob

  • Double importing of photoS

    Hi
    I wonder is anyone else having trouble with iphoto doubling your imported photos? I connect my Nikon D90 and it is recognized but then it displays 2 of each picture on the SD card. If I import it imports 2 of each photo. Help!

    Actually this question IS answered--by the last poster. Nikon software shows the two images as a single image, but iPhoto (correctly) separates them into a RAW image and a JPEG image so they may be edited independently. If you select either image, iPhoto identifies whether you have chosen the RAW image or the JPEG. The size of a RAW image as a file is roughly three times the size of a "fine" JPEG, so if you don't have a real reason to use RAW, you will be able to record many, many more images on your memory card just by selecting "JPEG Fine" from the menu in your Nikon D90.

  • Double import with Canon cam

    Hello
    I found out that if I import my pictures from the Canon cam into iPhoto, they ALL get imported twice: into iPhoto library AND into 'my pictures'. Seems to be that the installed Canon software somehow causes this to happen automatically. From a Minolta it does not happen.
    Possibly somebody made the same experience? I would like to let the Canon software on my Mac because some times it is helpful, but do not like all pics imported twice.
    Thanks!
    Donat
    G4 1.25 Dual, 2 GB   Mac OS X (10.4.5)   Canon A620

    In case somebody comes across this thread: I could solve the problem.
    In the Canon download software "Camera Windows" I checked under > Download Options > "Images whose transfer settings were specified with the camera".
    Donat
    G4 1.25 Dual, 2 GB   Mac OS X (10.4.5)   Canon PowerShot A620

  • IPhoto duplicates (doubles) all photos when importing

    Hi
    iMac 27 2009/10
    OSX 10.8.5
    iPhoto 11 9.4.3
    When importing from an iPhone (and i think a digital camera) iPhoto imports say 10 photos but it puts 20 into iPhoto - i.e. it duplicates every photo it imports
    It never used to do this and i can't see anywhere in preferences where there is a setting to import photos and double them up ?
    When we import some 100 photos and we get 200 into iPhoto its a real pain to have to go through them and delete the duplicates

    If you're shooting HDR photos with your iPhone and don't want double imports turn off the Keep Normal Photo under Settings ➙ Photos & Camera on your iPhone:
    Frankly, I'd keep the normal photo. It might be far better than the HDR version, if the camera was not perfectly stabilised or the target moved. Usually it requires the large screen on the Mac to be able to compare the normal photo to the HDR version, to be able to see, if the HDR version is passable.

  • Import statement -- Filesize^

    How does the import statement work anyway?
    Will it just "paste" the imported files in front of th class like a C preprocessor?
    If so, is there a way to import packages only once?
    I use (e. g.) java.awt.point in nearly ALL classes in my project, and at the moment, I import the class in every single file. If it will be pasted, this will significantly enlarge my project, I fear. Or does the compiler recognize double imports?

    How does the import statement work anyway?The import statement just gives the compiler some info so you don't have to fully qualify the class names.
    Will it just "paste" the imported files in front of th
    class like a C preprocessor?No
    It doesn't put anything into the compiled class, so won't affect the file size.

  • No Sound in Project with Imported MPEG 4

    I am new to iDVD.
    My first project is to just make a video from a short MPEG 4 movie clip.
    I imported the movie into iDVD and dropped it in. It plays fine except there is NO sound.
    When I press the select button in the on screen remote it plays the clip with sound.
    Any help appreciated.

    ... fine, you found a workaround ...
    the iLife package is a ... ehm... package, a suite of tools, which are intended to work together... therefore, iM is meant to work with firewire connected miniDV (=no mepgs), iDVD is meant to work with output of this app (=dv) ... and so on...-
    they are NOT meant as "all-purposes"-app... as many PCuser like to use Word for layouts, Excel for painting, PowerPoint for moviemaking... nooo, in the Apple World simplicity&convience is accomplished by restrictions of the app ..
    in other words: you try to teach the old dog new tricks... means: could work, could not work..
    and as mentioned above: video codecs is a VERY complicated issues.. there're ~4000 codecs swirrling thru the web...
    if you use the iApps as intended, no double-import etc are needed...
    think about investing into tools as QTpro or VisualHub (http://www.techspansion.com/visualhub/), which are "converters".. iDVD expects "dv-streams"... THEN it works like charm...
    happy editing, encoding, converting ...

  • Iphoto import creating and importing duplicates/ios8

    I'm using iphoto 9.4.3 and my iphone 5s with ios8.  Since septemberish (ios8 update), it's been double-importing all my pix on from my iphone - none are showing up as duplicates on the phone but import/iPhoto view shows and imports them all twice.  All images come in as img_1234 and img_1234_2 for example.
    Can't figure out why this is but it's a pain - I'm using third party software to scrub duplicates from the library after the fact but is anyone else having this problem?

    I've got this same problem. Didn't see this thread before I posted mine (Re: iPhoto imports 2 of every photo - iPhone 6).
    I've tried:
    Hard restart iPhone
    Updated iPhoto (9.6)
    Updated OSX (10.10)
    Updated iOS (8.1.1)
    Nothing has worked; I get two of every photo and video imported into iPhoto.
    Has anyone else solved this issue? It's not a huge problem; more like an annoyance.

  • IPhoto not finding all photos when importing

    I'm trying to import 14,499 photos. The problems is when I drag it over or click file import it only imports about 12,200. What happened to the other 2,299? I clicked yes to import duplicate photos. I plan on running duplicate annihilator once all of the photos are in. I can't tell which folder or photos it's not importing. The pictures are in 50 folder, and several have sub folder. I have tried running it on the laptop hard drive, and a external hard drive with 2 different libraries and still same problem.
    Message was edited by: tech09321

    If you're shooting HDR photos with your iPhone and don't want double imports turn off the Keep Normal Photo under Settings ➙ Photos & Camera on your iPhone:
    Frankly, I'd keep the normal photo. It might be far better than the HDR version, if the camera was not perfectly stabilised or the target moved. Usually it requires the large screen on the Mac to be able to compare the normal photo to the HDR version, to be able to see, if the HDR version is passable.

  • Converting a Date to a Double. How?

    I need to be able to a Date to a double in the "days since 12/30/1899 . fractional part is time format".
    This is the format use in OLE 2.0 Automation as well as languages such as Delphi.
    Any ideas?

    I assume this format (double) is the same format used for a MS date and if this is the case MS uses a base date (zero) of "Dec. 30, 1899 12:00:00 AM.". To take the 12:00:00 AM time into consideration when converting your date you should use a Java base date of "Dec. 29, 1899 23:00:00.000 GMT" or -2209147200000L as a long. Here is the code I use to convert between Java dates (long) and MS dates (double):
    import java.util.Date;
    public class MSDate extends Date {
       private final static int MILLISECONDS_IN_A_DAY = 86400000;
       private final static long MS_BASE_DATE = -2209147200000L; // December 29, 1899, 23:00:00.000 GMT.
       /** Allocates a MSDate object and initializes it so that it
           represents the time at which it was allocated, measured to the
           nearest millisecond. */
       public MSDate() {
          super();
       /** Allocates a MSDate object and initializes it to represent the
           specified number of milliseconds since the standard base time
           known as "the epoch", namely January 1, 1970, 00:00:00 GMT. */
       public MSDate(long date) {
          super(date);
       /** Allocates a MSDate object using the given MS date. */
       public MSDate(double MSDate) {
          this.setMSDate(MSDate);
       /** Sets this MSDate object to represent the MS date (double) provided. */
       public void setMSDate(double MSDate) {
          double dMilliseconds;
          // Convert MS Date (double) to the number of milliseconds since January 1, 1970, 00:00:00.000 GMT.
          dMilliseconds = MSDate * MILLISECONDS_IN_A_DAY;
          // Add MS's base date.
          dMilliseconds += MS_BASE_DATE;
          super.setTime(Math.round(dMilliseconds));
       /** Returns a MS date (double) that represented by this MSDate object. */
       public double getMSDate() {
          double dMSDate = 0;
          double dMilliseconds;
          // Get the number of milliseconds since January 1, 1970, 00:00:00.000 GMT.
          dMilliseconds = this.getTime();
          // Subtract MS's base date.
          dMilliseconds -= MS_BASE_DATE;
          // Convert milliseconds back to a MS date (double).
          dMSDate = dMilliseconds / MILLISECONDS_IN_A_DAY;
          // Return the MS date.
          return dMSDate;
    }The only thing that I have noticed is that MS (VB) doesn't display the milliseconds, so a MS date gets rounded up by one second if your Java date has more then 500 milliseconds.

  • Importing AVI to iPhoto 7.1.1

    I just purchased the Canon PowerShot G9 and I'm having trouble transferring video footage in AVI to iPhoto 08 (7.1.1). Upon turning the camera on, which is connected to my MacBook via the USB port, iPhoto prompts if I would like to "import", upon clicking on import, iPhoto shuts down.
    Relaunching iPhoto strangely indicates that there are double the number of items to be imported. (If I have taken 2 photos/videos, it now says that there are 4 photos/videos to be imported). Upon clicking on import, iPhoto shuts down again.
    PLEASE HELP!

    Yellowfish
    One issue is probably become two now.
    1. The difficulty with the avi format is that it's a container for a wide variety of codecs, not all of which are installed on your Mac, and some of which are not even available for the Mac. First port of call: Install Perian, which includes many of the more common codecs. You might also check the Canon site for updated drivers.
    IN any event, you might like to use Image Capture to move the files to the Desktop, and then try import them.
    2. The Doubled import is probably due to the last imports being left unfinished. Right click on the iPhoto Library in your Pictures Folder and choose 'Show Package Contents'. A Finder window will open with the library exposed. Have a look for a folder called 'Importing' or 'Imports', and see if your files are in there. IF so, drag it to the desktop and relaunch iPhoto.
    Regards
    TD

  • Clip twice imported into timeline

    I don't know how this happens... I always import the same way: go to Log and Transfer, select the clips (P2) and then "add selection to queue". then I double click in the browser to load it and then drag the clip to the right window to load it in the timeline. I noticed, that more than 50 % of the clips are double imported. Well, I can delete the first one, but this is troublesome when you have hundereds of clips!
    I just wonder what would cause that double import?
    Never had that problem before.
    Thank you
    Dorian

    I don't know how this happens... I always import the same way: go to Log and Transfer, select the clips (P2) and then "add selection to queue". then I double click in the browser to load it and then drag the clip to the right window to load it in the timeline. I noticed, that more than 50 % of the clips are double imported. Well, I can delete the first one, but this is troublesome when you have hundereds of clips!
    I just wonder what would cause that double import?
    Never had that problem before.
    Thank you
    Dorian

  • Recognizing movies when importing in imovie

    hi
    Have a question: where in imovie can i mark or find settings whereby imovie will recognize on my videocamera (sony) what already has been imported before, such that there is no double import?
    Problem is now that i need to go and look everytime what is already on my mac and what is not. Any other program in the past easily recognized what had already been imported and what not. I cant imagine that imovie cannot do this?
    Anyone that can help me?
    tx

    NTFS is also an option.
    There is an open source solution ntfs-3g (http://en.wikipedia.org/wiki/NTFS-3G).
    A commercial option is the Paragon NTFS for Mac.
    The other way around where Windows can access HFS+ drives is the Mediafour MacDrive.
    HTH

  • Double error

    I have a string "20d" and I do
    double importe = new Double(request.getParameter(IMPORTE).replace(',', '.')).doubleValue();
    This does not fail. Why is that?
    Thanks

    I thought it should fail because I didn't realize
    that it was a 'd'. II mean, if it were '20s' it
    fails, but '20d' does not fail because d is double (I
    suppose)
    Is there any way to make it fail?
    Thanksnot really. you're going to have to check for this case yourself, and manually cause it to fail (i.e. throw a number format exception, i suppose). If you do that, then you also need to be very clear to your users that the d cannot follow a double number in your particular application, because ordinarilly, that would be valid. The d at the end of a number indicates that it is in fact a double, so Double will not see this as an error.

Maybe you are looking for