Why I always got a warning when compiling

this is a small test on how to use Vector, i know it may not necessary
my problem is the compiler always warns me that
warning
==============================
Note: F:\SmallTest_Car.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
(how to apply -Xlint, when use jcreator 3.5?)
Process completed.
==============================
can you help me find out the very reason?
this is my program
=================
class Car
     double dHoursParked;
     double dCharges;
     public Car(double dFrist, double dSecond)
          dHoursParked=dFrist;
          dCharges=dSecond;
}//end class car-----------------
import java.util.*;
class SmallTest_Car
     public static void main(String args[])
          Vector carRecords=new Vector(5);
          carRecords.add(new Car(1.0,2.0));
     }//end main
}//end class question1after catch Exception, also got warning
=============
import java.util.*;
class SmallTest_Car
     public static void main(String args[])
          Vector carRecords=new Vector(5);
          try
               carRecords.add(new Car(1.0,2.0));
          catch(Exception e){     }
     }//end main
}//end class question1

- ignore the warning as it is not an error.worst suggestion.Except there are cases where valid working code produces warnings of this type which cannot be avoided. In some cases you have to just ignore the warning.

Similar Messages

  • I always got error message when opening BlackBerry App World using 3g

    Hi there, I always got error message when opening BlackBerry App World using 3g network, but it's fine if I open it through wifi network. Does anyone ever had the same problem and how to fix it? Thanks.

    You need the latest version of BlackBerry World installed on your smartp

  • Hi..i always got this massage when i want to buy (please connect itunes support to complete transaction)

    hi..i always got this massage when i want to buy (please connect itunes support to complete transaction)

    Do as the message says and contact iTunes Support. http://apple.com/support/itunes/contact/

  • -Xlint warning when compiling with command prompt.

    1 of the method i write in the program has a compilation warning when compiling with command prompt. When i compile the codes with the application i used to write the program has no error at all. Below is my code:
    private static ArrayList readNum(String NumFile)
    ArrayList key = new ArrayList();
    String keyAttributes = readInput(NumFile);
    StringTokenizer stk = new StringTokenizer(keyAttributes);
    while(stk.hasMoreTokens())
    key.add(stk.nextToken());
    return key;
    When i javac the program with -X;int, this errror occured:
    warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.ArrayList
    key.add(stk.nextToken());
    ^
    1 warning
    Anyidea how to solve this problem? Thanks for the help.

    A quick google for that message would have told you that you're not using generics and the compiler complains about that.
    Google for "Java Generics" to find out what all the fuss is about.

  • HT201263 My iphone 5s fell from my hand and went off, It refused coming up again. I always got the massage when ever i plug it on itune( iphone recorvery mode) Please what can i do?

    My iphone 5s fell from my hand and went off, It refused coming up again. I always got the massage when ever i plug it on itune( iphone recorvery mode) Please what can i do?
    <E-mail Edited by Host>

    Did you already try to reset the phone by holding the sleep and home button for about 10sec, until the Apple logo comes back again? You will not lose data by resetting.
    If this does not help, try to connect in recovery mode, explained here:
    iOS: Unable to update or restore
    If still no luck, you'll have to contact Apple Support to get it serviced:
    iPhone - Contact Support - Apple Support

  • Cc got assertion error, when compiling emacs-23.3

    I got an assertion error with cc as follows, when compiling emacs-23.3.
    It compiles fine without the "-O" option.
    I can provide a CPP processed file which reproduces it.
    ;; I could not find a place to report bugs, and I put it here.
    ;; Sorry if it is not an appropriate place.
    % cc -V
    cc: Sun C 5.12 SunOS_i386 2011/11/16
    % cc -c -Demacs -DHAVE_CONFIG_H -I. -I/work/emacs/emacs-23.3/src -I/usr/dt/include -g -O font.c
    "font.c", line 185: warning: integer overflow detected: op "<<"
    "font.c", line 197: warning: integer overflow detected: op "<<"
    "font.c", line 215: warning: integer overflow detected: op "<<"
    "font.c", line 2995: warning: integer overflow detected: op "<<"
    "font.c", line 3422: warning: integer overflow detected: op "<<"
    "font.c", line 3920: warning: assignment type mismatch:
    pointer to char "=" pointer to unsigned char
    "font.c", line 3945: warning: assignment type mismatch:
    pointer to char "=" pointer to unsigned char
    "font.c", line 4026: warning: integer overflow detected: op "<<"
    assertion failed in function pg_first_pass_do_block_rec() @ post_gen.c:3758
    assert(blk_sp_offset_(nextb) == (current_offset + get_prologue_size() + BITS2BYTES(be_cur_local_size)))
    cc: ube failed for font.c

    Got it ...
    Reduced testcase:
    % cat c.c
    enum Lisp_Type
    Lisp_Int0 = 0,
    Lisp_Float = 7,
    struct Lisp_Float
    union
    double data;
    struct Lisp_Float *chain;
    } u;
    struct Lisp_Vector
    unsigned int size;
    struct Lisp_Vector *next;
    int contents[1];
    int
    font_unparse_xlfd (font, pixel_size, name, nbytes)
    int font;
    int pixel_size;
    char *name;
    int nbytes;
    char *f[21];
    int val;
    int i, j, len = 0;
    val = ( ( struct Lisp_Vector * ) ( ( unsigned int ) ( ( ( font ) ) & ( ( ( ( int ) 1 ) << ( 32 - 3 ) ) - 1 ) ) ) ) -> contents [ 5 ];
    if ( ( ( ( enum Lisp_Type ) ( ( ( unsigned int ) ( ( val ) ) ) >> ( 32 - 3 ) ) ) == Lisp_Float ))
    i = ( ( ( void ) 0 , ( struct Lisp_Float * ) ( ( unsigned int ) ( ( val ) & ( ( ( ( int ) 1 ) << ( 32 - 3 ) ) - 1 ) ) ) ) -> u . data + 0 ) * 10;
    f[2] = __builtin_alloca ( 12 );
    else
    f[2] = "*-*", len += 4;
    % cc -g -O c.c -V
    cc: Sun C 5.12 SunOS_i386 2011/11/16
    acomp: Sun C 5.12 SunOS_i386 2011/11/16
    "c.c", line 41: warning: implicit function declaration: __builtin_alloca
    "c.c", line 41: warning: improper pointer/integer combination: op "="
    iropt: Sun Compiler Common 12.3 SunOS_i386 2011/11/16
    ir2hf: Sun Compiler Common 12.3 SunOS_i386 2011/11/16
    ube: Sun Compiler Common 12.3 SunOS_i386 2011/11/16
    assertion failed in function pg_first_pass_do_block_rec() @ post_gen.c:3758
    assert(blk_sp_offset_(nextb) == (current_offset + get_prologue_size() + BITS2BYTES(be_cur_local_size)))
    cc: ube failed for c.c
    Bug 7167252 filed. If we find a work-around I'll post it.

  • Why i always got timeout if upload a file from other connection?

    I upload a file via FTP, it work well if i upload from my office, but i always got timeout if i upload from my house, why it can like this?
    thx...

    I already set to passive mode and it work but other not wongking
    this one work and can upload
    ftp.setConnectTimeout(timeout);
    ftp.connect(server);
    ftp.enterLocalPassiveMode(); // here i set to passive mode
    ftp.login(user, pass);
    ftp.setDataTimeout(timeout);
    ftp.setSoTimeout(5000);
    tmpFilename = "XXX";
    ftp.setBufferSize(MAX_UPLOAD_FILE);
    ftp.setFileType(ftp.BINARY_FILE_TYPE);
    myFile = new RandomAccessFile("xxx.zip", "r");
    ftp.enterLocalPassiveMode();
    ftp.sendNoOp();
    stD = ftp.appendFileStream(tmpFilename);
    myFile.seek(uploadedByte);
    byte[] b = new byte[MAX_UPLOAD_FILE];
    while ((len = myFile.read(b)) != -1) {
         stD.write(b, 0, len);
    }but this one not working, why?
    tmpFilename = "xxx";
    ftp.setConnectTimeout(timeout);
    ftp.connect(server);
    ftp.enterLocalPassiveMode(); // here i set to passive mode
    ftp.login(user, pass);
    ftp.setSoTimeout(5000);
    ftp.setDataTimeout(timeout);
    ftp.setBufferSize(MAX_UPLOAD_FILE);
    ftp.setFileType(ftp.BINARY_FILE_TYPE);
    byte[] b = new byte[MAX_UPLOAD_FILE];
    FileInputStream fis;
    File file;
    file = new File("xxx.zip");
    fis = new FileInputStream(file);
    if (ftp.storeFile(tmpFilename, fis)) {
         System.out.println("upload Success")
    } else {
         System.out.println("upload Fail")
    }Edited by: sayunara on Aug 26, 2009 9:43 AM

  • Strange warning when compiling for iOS, "PIE disabled", Is it safe to submit to the App Store?

    I get this warning when building:
    ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in _llvm_unwind from AOTBuildOutput-0.o. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
    The app appears to be fine so far, and I haven't seen it mess up anything functionally yet, but am still testing.
    Edit: I am also curious as to what exactly this is. I think it is possibly related to an ANE that I NEED to use to work around a bug in AIR.

    I have never seen this warning cause any issues with the app so far.

  • CVI aborts with no warning when compiling

    When I compile a simple instrument driver with the CTRL-K shortcut in CVI 2009 (9.1) it aborts CVI without warning
    No popup, no nothing.
    All I had done was delete a typedef in the driver file for a structure containing GPIB configuration info.
    After it did it about 5 times in a row it finally stopped when I included a header file that re-established the typedef for the GPIB struct.
    So the problem was that this typdef appeared as a parameter type in a prototype in another header file, and when I eliminated the definition it caused the abort. The abort was immediate, I have to think it was something wrong in the preprocessor.  I do not have precompiled headers checked in the build options.  I am using the standard CVI compiler. 
    Weird, huh.
    Menchar

    Some how I knew you'd ask for that
    I don't have a simple case. 
    It was absolutley repeatable, I couldn't believe it when it first happened.
    I had something like this in the driver file:
    typedef struct _GPIBConfig {
      DWORDBus;
    } GPIBCONFIG, * LPGPIBCONFIG;
    and in a header file I had a prototype that used the typedef as a parameter type:
    headerfile.h
    INT myFunc (GPIBCONFIG config);
    When I eliminated the typedef  from the driver file, I got the crash.
    When I added another header that defined the GPIBCONFIG struct, the crashes stopped.
    Restarting CVI did not cure the problem.  When I restarted, CVI did a popup saying the previous instance of CVI had been stopped abnormally.   I recovered the project per the popup.  Then when I restarted and recompiled, it crashed again, but when I restarted I didn't get the popup.
     Menchar

  • Warning - When Compiling .jsp pages under WEB-INF

    Created a directory jsp under WEB-INF and when i compile the jsp pages i get the following warning message
    Warning: package name web2d_inf._jsp does not match source file name C:\ProviderEnrollment\ProvEnrollView\classes\.jsps\_WEB_2d_INF\_jsp\_searchprovider.java
    Need help
    Thanks

    We have encountered this warning too.
    I'm not an Oracle employee, but it looks like there's a bug in JDev that preserves the case for the output directories but not for the package name that is supposed to correspond to the output directories.
    In any case, we haven't seen any runtime problems that seem to be related to this warning, so you may be safe to disregard it. It does foul up the build log though.
    Any JDev team members watching this topic are welcome to chime in with a confirmation and details of this apparent bug, as well as any workaround that might exist to avoid having the warning appear. Thanks!

  • I got this warning when i open a specific page on my website in IE : MuseJSAssert: Error calling selector function:Error: A security problem occurred.

    Hi,
    I found out when i'm in IE and go to the page 'Artists'
    and i click on a name, for example: 'Abel Equipe ELA/I Gomes'
    I get this warning :
    MuseJSAssert: Error calling selector function:Error: A security problem occurred.
    This is only in IE, not when i use Safari or Chrome
    this is the website link
    Any ideas how to solve this problem?

    There's an invalid hyperlink on the Abel Equipe ELA/I Gomes page on a bit of text that reads "with your input." You need to find this text within Muse, clear the hyperlink and enter a valid one.

  • Why do I receive this warning when working with an ArrayList?

    The warning I receive...
    Note: C:\Documents and Settings\Owner\.netbeans\4.1\Cis320\Lab6\src\scanPorts.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    The code it is reffering to...
                //fill the ArrayList with ports to be scanned
                int totalPorts = LAST_PORT - FIRST_PORT + 1;
                ArrayList ports = new ArrayList(totalPorts);
                for(int i = FIRST_PORT; i <= LAST_PORT; i++){
                    PortInfo current = new PortInfo(i);
                    ports.add(current);
                }

    Yup, that is exactly what it is telling me. Thanx for the reply.
    Generics are new to me, I found documentation on generics at...
    http://java.sun.com/developer/technicalArticles/releases/j2se15langfeat/
    My code now looks like...
                //fill the ArrayList with ports to be scanned
                int totalPorts = LAST_PORT - FIRST_PORT + 1;
                ArrayList<PortInfo> ports = new ArrayList<PortInfo>(totalPorts);
                for(int i = FIRST_PORT; i <= LAST_PORT; i++){
                    PortInfo current = new PortInfo(i);
                    ports.add(current);
                //the <PortInfo> is known as a generic
                //Generics, which are also known as parameterized types, provide
                //compile-time typesafety for collections and eliminate the drudgery
                //of casting.
                //Generics enable more compile-time type checking and therefore
                //mismatch errors are caught at compile time rather than at runtime.
                //So if I try to add a String to this ArrayList anywhere in this
                //code, the compiler will scream instead of me during runtime.

  • HT1338 Got this warning when I performed a Disk verification.Warning: SUID file "System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAg ent" has been modified and will not be repaired.

    This is the warning I get when I used disk verification in Disk Utilities
    Warning: SUID file “System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAg ent” has been modified and will not be repaired.

    Welcome to Apple Support Communities
    Don't worry about that message. You can ignore that > http://support.apple.com/kb/TS1448

  • HT4993 why it always say password incorrect when i put the password in my iphone5?

    why i cant get in to my wifi ? i know i am putting the correct password

    Chances are you are making an error in typing the password.

  • Warning upon compiling under JDev 3.1

    Does anyone know why I get the following warning when I do make on the JSP's under Jdeveloper 3.1 running on NT 4.0:
    ?Warning: (0)ISO-8859-1 character set may not match project compiler settings
    TIA,
    Sassan

    Thank you Anton,
    I've tryed your solution but nothing
    has changed, I always get the same message.
    I'v also tryed to select and unselect all
    the checkboxes and changed the name of
    the deployed application but the result
    is alwais the same.
    Please all of you out there I really need help!!!!!
    Where is the jdev team gone??
    mauro

Maybe you are looking for

  • Trash Bug?

    Is anyone having the problem, where if you drag a file to the trash, it doesn't show the icon as full, but still empty. Also when I right click the trash icon the empty trash button, so I have to go into trash to empty it and it is annoying. Does ano

  • Personal Oracle 8i Install Instructions

    This is a newbie question, so please be tolerant. I've downloaded Personal Oracle 8i for NT, but I cannot seem to find any installation instructions for it. Could somebody please stick my nose in them? Will this product run in Win 2000 Professional?

  • No internet access when cellular network is available?

    Folks, I'm looking for debug help. For two days now, I've had an almost complete lack of success in connecting to the Internet via my iphone. Environment: new-since-march iphone 3G running OS 2.2, Wifi OFF, airplane mode OFF, 4 full bars ATT 3G. Can

  • Why won't my Itunes update to 11.4 It always asks to restart but once i restart it, it just goes back to saying i need to update it again?

    Why won't my Itunes update to 11.4 It always asks to restart but once i restart it, it just goes back to saying i need to update it again?

  • Problema para guardar en pdf

    Cuando pongo GUARDAR en PDF.. se queda ahi sin hacer nada el programa, no puedo hacer nada.. pero si toco ESC ya esta normal, pero no me salen opciones de GUARDADO DE PDF; por lo cual no puedo hacer nada. No se si toque alguna configuracion o que. Ne