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.

Similar Messages

  • Action Script Error  Frequently I receive this warning when using Safari.  Should I be concerned? Frequently I receive this warning when using Safari.  Should I be concerned?

    I've tried to copy the error information without success.

    I typed out the first part of the message.  It reads:  
    SecurityError: Error #2060: Security sandbox violation: Externalinteface caller http:// s0.2mdn.net/3440770/MM Tech Leadership_Cloud Standard_728x90_flash.swf cannot access http://www.newyorker.com/ads/newad.html#http://ad.doubleclick.neet/adj/newyorker .dart/

  • Problem when working with package???Please, help me!!!

    I got 3 .java files from one Java tutorial as follow:
    Server.java (in package mygame.server)
    Utilities.java (in package mygame.shared)
    Client.java (in package mygame.client)
    All the above files are placed in "E:\Java Programmes\source"
    After compiling, i got correspponding .class files:
    Server.class (placed in "E:\Java Programmes\class\mygame\server")
    Utilities.class (placed in "E:\Java Programmes\class\mygam\shared")
    Clients.class (placed in "E:\Java Programmes\class\mygame\client")
    But when i run Server.class which contains main method, i got error as follow:
    E:\Java Programmes>java class\mygame\server\Server
    Exception in thread "main" java.lang.NoClassDefFoundError: class\mygame\server\S
    erver (wrong name: mygame/server/Server)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    That was very puzzled for me. I cannot find out what wrong with my files. Please., any boby, help me!!! I always got this problem when working with package and managing files. Thanls a lot.

    java -cp "E:\Java Programmes\class" mygame.server.Server

  • I keep getting calls, so I added that number to my list of calls to block.  It doesn't ring anymore, but I keep getting notification messages that say "Call back".  Why do I receive this when the call should be blocked?

    I keep getting calls from (removed), so I added that number to my list of calls to block.  It doesn't ring anymore, but I keep getting notification messages that say "Call back (removed)".  Why do I receive this when the call should be blocked?
    Private info removed as required by the Verizon Wireless Terms of Service
    Message was edited by: Admin Moderator

    Okay, you are correct the call is not supposed to ring in. Have you done any troubleshooting on the phone? First off, try power cycling the phone. Turn the phone off, then back on again. If that does not work, then try a reset. Hold the sleep/wake and home buttons together until you see the Apple logo and then release. The phone will reboot. See if that changes things. Is the caller using the exact number that you blocked, or is it possible they are using another number, or have restricted the Caller ID?

  • TS3833 I am receiving this error when syncing my ipod: iTunes could not copy "song name" to the iPod "name" because an unknown error occurred (-50).  I am using iTunes version 10.6.3.25. Why?

    I am receiving this error when syncing my ipod: iTunes could not copy "song name" to the iPod "name" because an unknown error occurred (-50).  I am using iTunes version 10.6.3.25. Why?

    Right click the filename that won't download and selsct 'Get Info'. Look at the file path, does it have a //?// in it? That is a problem with Amazon downloads that prevent iTunes from finding the file. Use 'Add Folder' to add the album to your library and try syncing it again

  • I have been trying to install Itunes for 3 days to my computer.  MY eyes burn and I want to smash this computer at this point!!!! HELP ME!!! I receive this message when I run the diagnostic on my iphone Microsoft Windows Vista Ultimate Edition (Build 6000

    I have been trying to install Itunes for 3 days to my computer.  MY eyes burn and I want to smash this computer at this point!!!! HELP ME!!! I receive this message when I run the diagnostic on my iphone
    Microsoft Windows Vista Ultimate Edition (Build 6000)
    Dell Inc. Studio 1535
    iTunes 10.6.1.7
    QuickTime not available
    FairPlay 1.14.37
    Apple Application Support 2.1.7
    iPod Updater Library 10.0d2
    CD Driver 2.2.0.1
    CD Driver DLL 2.1.1.1
    Apple Mobile Device Driver 1.57.0.0
    Bonjour 3.0.0.10 (333.10)
    Gracenote SDK 1.9.5.502
    Gracenote MusicID 1.9.5.115
    Gracenote Submit 1.9.5.143
    Gracenote DSP 1.9.5.45
    iTunes Serial Number 0020AEDC02A7C4B8
    Current user is an administrator.
    The current local date and time is 2012-04-17 17:05:40.
    iTunes is not running in safe mode.
    WebKit accelerated compositing is enabled.
    HDCP is supported.
    Core Media is supported.
    Video Display Information
    Intel Corporation, Mobile Intel(R) 965 Express Chipset Family
    Intel Corporation, Mobile Intel(R) 965 Express Chipset Family
    **** External Plug-ins Information ****
    No external plug-ins installed.
    **** Network Connectivity Tests ****
    Network Adapter Information
    Adapter Name:          {92497F93-8A79-419C-AA27-50CD2F263F77}
    Description:          Microsoft Virtual WiFi Miniport Adapter
    IP Address:          0.0.0.0
    Subnet Mask:          0.0.0.0
    Default Gateway:          0.0.0.0
    DHCP Enabled:          Yes
    DHCP Server:
    Lease Obtained:          Wed Dec 31 19:00:00 1969
    Lease Expires:          Wed Dec 31 19:00:00 1969
    DNS Servers:
    Adapter Name:          {6FECCC1D-04CF-4A3F-92B6-DC6E68D12BE5}
    Description:          Dell Wireless 1397 WLAN Mini-Card
    IP Address:          192.168.0.118
    Subnet Mask:          255.255.255.0
    Default Gateway:          192.168.0.1
    DHCP Enabled:          Yes
    DHCP Server:          192.168.0.1
    Lease Obtained:          Tue Apr 17 16:59:28 2012
    Lease Expires:          Wed Apr 18 16:59:28 2012
    DNS Servers:          192.168.20.254
                        192.168.30.217
    Adapter Name:          {3323A300-E864-46C3-A6B6-F0B90AFF4AFE}
    Description:          Broadcom NetLink (TM) Gigabit Ethernet
    IP Address:          0.0.0.0
    Subnet Mask:          0.0.0.0
    Default Gateway:          0.0.0.0
    DHCP Enabled:          Yes
    DHCP Server:
    Lease Obtained:          Wed Dec 31 19:00:00 1969
    Lease Expires:          Wed Dec 31 19:00:00 1969
    DNS Servers:
    Active Connection:          LAN Connection
    Connected:          Yes
    Online:                    Yes
    Using Modem:          No
    Using LAN:          Yes
    Using Proxy:          No
    Firewall Information
    Windows Firewall is on.
    iTunes is NOT enabled in Windows Firewall.
    Connection attempt to Apple web site was unsuccessful.
    The network connection timed out.
    Connection attempt to browsing iTunes Store was successful.
    Connection attempt to purchasing from iTunes Store was successful.
    Connection attempt to iPhone activation server was successful.
    Connection attempt to firmware update server was unsuccessful.
    The network connection timed out.
    Connection attempt to Gracenote server was successful.
    Last successful iTunes Store access was 2012-04-17 17:04:26.
    **** CD/DVD Drive Tests ****
    No drivers in LowerFilters.
    UpperFilters: GEARAspiWDM (2.2.0.1),
    E: Optiarc DVD+-RW AD-7640S, Rev HD14
    Drive is empty.
    **** Device Connectivity Tests ****
    iPodService 10.6.1.7 is currently running.
    iTunesHelper 10.6.1.7 is currently running.
    Apple Mobile Device Service not found.
    Universal Serial Bus Controllers:
    Intel(R) ICH8 Family USB Universal Host Controller - 2830.  Device is working properly.
    Intel(R) ICH8 Family USB Universal Host Controller - 2831.  Device is working properly.
    Intel(R) ICH8 Family USB Universal Host Controller - 2832.  Device is working properly.
    Intel(R) ICH8 Family USB Universal Host Controller - 2834.  Device is working properly.
    Intel(R) ICH8 Family USB Universal Host Controller - 2835.  Device is working properly.
    Intel(R) ICH8 Family USB2 Enhanced Host Controller - 2836.  Device is working properly.
    Intel(R) ICH8 Family USB2 Enhanced Host Controller - 283A.  Device is working properly.
    FireWire (IEEE 1394) Host Controllers:
    Ricoh 1394 OHCI Compliant Host Controller.  Device is working properly.
    **** Device Sync Tests ****
    No iPod, iPhone, or iPad found.

    This should get your itunes store connection working.
    Close your iTunes,
    Go to command Prompt -
    (Win 7/Vista) - START/ALL PROGRAMS/ACCESSORIES, right mouse click "Command Prompt", choose "Run as Administrator".
    (Win XP SP2 & above) - START/ALL PROGRAMS/ACCESSORIES/Command Prompt
    In the "Command Prompt" screen, type in
    netsh winsock reset
    Hit "ENTER" key
    Restart your computer.
    If you do get a prompt after restart windows to remap LSP, just click NO.
    Now launch your iTunes and see if it is working now.
    If you are still having these type of problems after trying the winsock reset, refer to this article to identify which software in your system is inserting LSP:
    iTunes 10.5 for Windows: May see performance issues and blank iTunes Store
    http://support.apple.com/kb/TS4123?viewlocale=en_US

  • Why do I get this error when trying to use my bluetooth headset as a listening device? There was an error connecting to your audio device. Make sure it is turned on and in range. The audio portion of the program you were using may have to be restarted.

    Why do I get this error when trying to use my bluetooth headset as a listening device? There was an error connecting to your audio device. Make sure it is turned on and in range. The audio portion of the program you were using may have to be restarted.

    I may have already resolved this issue buy removing the device from my computer and re-pairing it. It is currently working just fine.

  • TS1702 "The feature you are trying to use is on a network resource that is unabailable" Why am I getting this message when I try to updaate itunes or quicktime?

    The feature you are trying to use is on a network resource that is unabailable" Why am I getting this message when I try to updaate itunes or quicktime?

    Before trying the update again, use Microsoft's Fix it solution at http://support.microsoft.com/mats/Program_Install_and_Uninstall. Use it to uninstall iTunes and Quicktime. It bypasses this not uncommon problem. When the solution finishes, the selected program will be uninstalled. It can take several minutes and I have seen as much as half an hour.
    After iTunes & Quicktime are uninstalled, try the update again.

  • Why am I seeing this message when I try to access my Creative Cloud account - 'We are unable to load all your plans & products. Please try again.'

    Why am I seeing this message when I try to access my Creative Cloud account:
    'We are unable to load all your plans & products. Please try again.'
    I want to see which products are included with my CC subscription - e.g. do I have a Prosite portfolio website or would I need to pay for an additional subscription?
    Is this a temporary site issue or an on-going problem?

    Please refer here with information https://forums.adobe.com/thread/1499014
    -and try some steps such as changing browsers and turning off your firewall for downloads
    or
    A chat session where an agent may remotely look inside your computer may help
    Creative Cloud chat support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html
    Regards
    Rajshree

  • I cannot download OS X Mountain Lion, I get an error message that says: "We could not complete your purchase. The product distribution file could not be verified. It may be damaged or was not signed." Why am I receiving this message?

    I cannot download OS X Mountain Lion, I get an error message that says: "We could not complete your purchase. The product distribution file could not be verified. It may be damaged or was not signed." Why am I receiving this message?

    Servers may be overloaded.
    One user reported:
    Deleted file com.apple.appstore in /var/folders/, dissabled VirusBarrier X6: problem solved!

  • When trying to open in external editor I get this warning when going to Photoshop CS6: Could not complete your request because an unexpected end-of-file was encountered.

    Aperture: When trying to open in external editor I get this warning when going to Photoshop CS6: Could not complete your request because an unexpected end-of-file was encountered. I can export and open via Photoshop or open directly from file-just not through external editor. Gerry

    Hi gerry,
    does this happen for a particular image only, or for all images?
    And does this happen only from your account or also from other user accounts?
    Léonie

  • The photos in my photo stream removed and it says you don't have enough storage and your device why I am receiving this message and why my photos erased from photo stream

    The photos in my photo stream removed and it says you don't have enough storage and your device why I am receiving this message and why my photos erased from photo stream

    Try deleting the old backup.
    Settings>iCloud>Storage & Backup>Manage Storage, tap the device name and on the resulting screen, scroll down and tap on Delete Backup.

  • More than maximum 5 filtered album lists trying to register. This will fail,Why i am getting this error when i pick video from Photo library.

    I am able to pick 4 videos from the Photo library in my iPhoneAPP but when i try to pick 5th one it throws an error:
    "More than maximum 5 filtered album lists trying to register. This will fail,Why i am getting this error when i pick video from Photo library."

    Hello Tate r Bulic
    I don't have any idea how to remove this error,can i pick more than 5 videos from the photo library...
    If it's then please help me and gimme idea..Thanks

  • Why do I get this message when I try to download Mtn Lion? I have updated all software and am running Lion. "We could not complete your purchase. OS X Mountain Lion is not compatible with this computer.

    Why do I get this messge when I try to download Mtn Lion? "We could not complete your purchase. OS X Mountain Lion is not compatible with this computer." I am currently running Lion and have updated all Apps and Software. I have version 10.7.5.

    Hi Mtn Mama,
    Sounds like your Mac may not be compatible with OSX Mountain Lion. Here is a link with the list of compatible Macs:
    http://www.apple.com/osx/specs/
    GB

  • HT201263 Error: source not supported. Why do I get this message when I try to play a video?

    Error: source not supported. Why do I get this message when I try to play a video?

    Did you copy the songs directly from a CD or did you download the files from a website?
    You can use a different player than the Windows Media Player to play the songs if you copied them from a CD to avoid that.

Maybe you are looking for

  • Intermittently no picture playing movies in 2.3

    Since upgrading to Apple TV 2.3 occasionally when I start playing a movie I can hear the sound but there is no image. Restarting the Apple TV fixes the problem. The first time I noticed it was when playing Wall-E (puchased from the iTunes Store), but

  • Link to specific text from another web page

    Hello all Is is possible to link from one page to a specific piece of text in another web page in the same site? I have tried named anchor, hyperlink, etc but it just goes to the page rather than the text. I don't know if I am attempting the impossib

  • Colors Became Darker

    [InDesign 5.0.2 for Windows (Vista)] On 2 pages of an 8-page document, the colors in both text and objects are darker than they should be (regardless of whether the content comes from a master page or the regular page, whether it was there before, or

  • Append structure to ztable

    hi all,        i have one ztable. . for this i have to append structure with 3 new fields to that ztable. can u plz tell me how to do it.

  • How can I make Edit/Default Customization form with Java ?

    In previous portal relise developers have simple way to rendering Edit/Default Customization form: <% PortletRendererUtil.renderCustomizeFormHeader(portletRequest, out, null, "services_action", null, null); %> <TABLE BORDER="0" CELLPADDING="0" CELLSP