Puzzled with terminology (again)

at some point i read this from api (NullPointerException):
is created when:
Calling the instance method of a null object.
Accessing or modifying the field of a null object.
Taking the length of null as if it were an array.
Accessing or modifying the slots of null as if it were an array.
Throwing null as if it were a Throwable value.
working on the java online tutorial i got this:
Exercise: The following program, WhatHappens, contains a bug. Find it and fix it.
// This program compiles but won't run successfully.
public class WhatHappens {
    public static void main(String[] args) {
        StringBuffer[] stringBuffers = new StringBuffer[10];
        for (int i = 0; i < stringBuffers.length; i ++) {
            stringBuffers.append("StringBuffer at index " + i);
Answer: The program generates a NullPointerException on line 6. The program creates the array, but does not create the string buffers, so it cannot append any text to them.
Well, from what i understand the array is created but each object that populates it isnt created, so each of these objects has a NULL value.
so i'm inclined to second case : (for the error msg)
Accessing or modifying the field of a null object.
My Q:
is it correct to think like this:
field means the value assigned to obj (in this case every member of array)?
thanks in advance

Not quite- the array consists of elements that are null. It's OK to get the value of the element, as the array isn't null- rewrite the code as public class WhatHappens {
    public static void main(String[] args) {
        StringBuffer[] stringBuffers = new StringBuffer[10];
        for (int i = 0; i < stringBuffers.length; i ++) {
            StringBuffer element = stringBuffers;
System.out.println(element);
element.append("StringBuffer at index " + i);
}And then see where the exception is thrown.
Pete

Similar Messages

  • My iPod Classic is seen by Windows but not by iTunes.  I have reset it, gone to disk mode and it won't show up in iTunes.  There appears to be music on it in a file called MUSICSAVE.  How can I get this to work with iTunes again?

    My iPod Classic is seen by Windows but not by iTunes.  I have reset it, gone to disk mode and it won't show up in iTunes.  There appears to be music on it in a file called MUSICSAVE.  How can I get this to work with iTunes again?

    1. Update iTunes to the latest version. Plug in your iPod. If iTunes still can't recognize it, then in iTunes in the top left corner click help> run diagnostics. On the box that comes up, check the last two things. Click next and it should identify your iPod.
    2. Click on your windows start menu. Type in "services". Click on it and when it pops up, on the bottom of it click on "standard". Now Scroll down to find "Apple Mobile Device" Right click it when you see it and click on "Start". When it has started, close iTunes and replug in your iPod and it should show up.
    3. Check the USB cable
    4 Verify that Apple Mobile Device Support is installed
    5. Restart the Apple Mobile Device Service and verify that the Apple Mobile Device USB Driver is installed.
    6. If you just want to add some photos, songs and movies from computer to your devices, you can use an iTunes alternative to do the job
    7. Check for third-party software conflicts.
    <Link Edited By Host>

  • Ive had my ipod just over a year now and its deciding to play up and wipe the whole thing so its like brand new untill i sync it with itunes again, but this time it wont seem to restor the ipod just flashes white and then comes as before, Help?

    As i said abouve,
    Ive had my ipod just over a year now and its deciding to play up and wipe the whole thing so its like brand new untill i sync it with itunes again, but this time it wont seem to restor the ipod goes onto a black screen with the apple logo and a bar that is ment to fill up but this bar doesnt seem to be doing anything after a while it just flashes white and comes up with the sync to itunes picture.
    Any help would be appreciated
    Thanks
    Bec

    If you've had it for less than a year, then it's still under warranty.  Take it to an Apple store or an authorized service facility.  See http://support.apple.com/kb/HT1434

  • How can I restart with itunes again  as I seem to have duplicate folders in Music and Itunes?

    I seem to have partially duplicate Music folders  on my computer one called Music (/Users/barry) which is 86.9 gb and one called Itunes music (/Users/barry/Music/iTunes) which is 60.9 GB.
    I also have a folder of 25GB in /Users/barry/Music/iTunes/iTunes Master Library recreated 29jul2014/iTunes
    I am totally confused as to whether these are really duplicates or how to solve this but am desperate to free up some space on my hard drive.
    Are all these necessary or can I delete any please?
    Can I start with Itunes again without endangering my music collection?
    I am using 11.1.5 version of Itunes.
    Mac OSX 10.6.8
    Many thanks for any advice

    iTunes 9 [and later]: Understanding iTunes Media Organization - http://support.apple.com/kb/ht3847
    Image of folder structure and explanation of different iTunes versions (turingtest2 post) - https://discussions.apple.com/docs/DOC-7392
    You'll have to determine which are actually currently used, either by getting Info on a representative sample and seeing to which file each points, or by deleting the old structure files and seeing if iTunes has a fit.
    Back up your computer first and try.

  • Can i make a puzzle with elemets13?

    Can i make a puzzle with elemets13

    On iPod 4G to take a screenshot press the on/off Sleep button and the Home button at the same time.
    The photo shows up in normal Photo Camera Roll.
    Hope it works on your 3G, but about that I can't say for sure.

  • I can't download any apps on my iTunes account, I click 'free' type in password press okay and goes off and comes up with free again and doesn't download??

    I can't download any free apps on my iTunes account, I click 'free' then type in my password, press okay and goes off and comes up with free again and doesn't download?? Someone help

    Hello _slothy_,
    Thank you for the details of the issue you are experiencing with the iTunes Store on your iPhone 5c.  For this issue, I recommend signing out and back into the iTunes Store on your iPhone:
    Sign in with a different Apple ID
    Tap Settings > iTunes & App Stores.
    Tap your Apple ID.
    If you see the option to Sign In, you can change your Apple ID now.
    Tap Sign Out.
    Enter your Apple ID and Password and tap Sign In.
    You can find the full article here:
    iOS: Sign in with a different Apple ID in the iTunes Store, App Store, and iBooks Store
    http://support.apple.com/kb/HT1311
    If the issue persists after signing out and back in, I recommend quitting and relaunching the applications on your iPhone:
    Double-click the Home button.
    Swipe left or right until you have located the app you wish to close.
    Swipe the app up to close it.
    You can find the full article here:
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    If you are still seeing the same issue after quitting and relaunching the iTunes Store app, I recommend restarting your phone and then resetting if it's still not working:
    How to restart
    Press and hold the Sleep/Wake button on the top of your device until the red slider appears. Then drag the slider to turn your device completely off.
    After the device turns off, press and hold the Sleep/Wake button again until you see the Apple logo.
    How to reset
    You should reset your device as a last resort and only if you can't restart it.
    To reset, press and hold both the Sleep/Wake and Home buttons for at least 10 seconds, until you see the Apple logo.
    You can find the full article here:
    Turn your iOS device off and on (restart) and reset
    http://support.apple.com/kb/ht1430
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Duplicates entries in "open with" menu AGAIN....

    Hey guys
    I have an issue with the Open With Crtl + click menu, i get duplicates of the programs that can be used to open the file, i konw that this problem was there since tiger and leopard, but now with SL i'm dissapointed of this issue AGAIN. I hope Apple its aware of this forum and resolves this problem with an update soon
    If anyone knows a practical solution, please post it
    Thanks and greetings from Mexico
    Oscar

    Hi again: OK, I am not really losing my mind, honest. Right clicking on a PDF file on the desktop and selecting "Open With" gave me not Duplicates, but Quadruplicates of each choice. I then selected the same PDF file and clicked "File" from the menu bar and then "Open With" and all was good, only one of each choice. I then go back to the "Right Click" method, all back to normal, one of each. Strange indeed.
    Stedman

  • Mapping issue with context again

    I again need help with a mapping issue. I don’t know how to handle the contexts to get this working in the xi graphical mapping tool.  I have previously logged a question regarding this structure but the requirements have now changed. 
    I have a source document that has multiple delivery line items and for each delivery line item, there are multiple handling units. Each handling unit contains the line number of the delivery line item it belongs to. This structure has been simplified below.
    <b><u>Source Sample</u></b>
    <DOCUMENT>
    <DELIVERY_LINEITEM>
    <LINENUMBER>10</LINENUMBER>
    <MATERIAL>mat 1</MATERIAL>
    </DELIVERY_LINEITEM >
    <DELIVERY_LINEITEM >
    <LINENUMBER>20</LINENUMBER>
    <MATERIAL>mat 2</MATERIAL>
    </DELIVERY_LINEITEM >
    <HANDLING_UNITS>
    <HU_LABEL>123</HU_LABEL>
    <HU_ITEM>
    <LINENUMBER>10</LINENUMBER>
    </HU_ITEM>
    </HANDLING_UNITS>
    <HANDLING_UNITS>
    <HU_LABEL>456</HU_LABEL>
    <HU_ITEM>
    <LINENUMBER>10</LINENUMBER>
    </HU_ITEM>
    </HANDLING_UNITS>
    <HANDLING_UNITS>
    <HU_LABEL>789</HU_LABEL>
    <HU_ITEM>
    <LINENUMBER>20</LINENUMBER>
    </HU_ITEM>
    </HANDLING_UNITS>
    </DOCUMENT>
    <u><b>Source Structure</b></u>
    DOCUMENT 1..1
    DELIVERY_LINEITEM 1..unbounded
    LINENUMBER 1..1
    MATERIAL 1..1
    HANDLING_UNITS 1..unbounded
    HU_LABEL 1..1
    HU_ITEM 1..1
    LINENUMBER 1..1
    In the target structure, I need to output each handling unit along with the corresponding DELIVERY_LINEITEM material.  Target structure has been simplified below:
    <u><b>Target Sample</b></u>
    <DOCUMENT>
    <ROW>
    <PACKAGING>
    <HU_LABEL>123</HU_LABEL>
    </PACKAGING>
    <PACKAGING_ITEM>
    <LINENUMBER>10</LINENUMBER>
    <MATERIAL>mat 1</MATERIAL>
    </PACKAGING_ITEM>
    </ROW>
    <ROW>
    <PACKAGING>
    <HU_LABEL>456</HU_LABEL>
    </PACKAGING>
    <PACKAGING_ITEM>
    <LINENUMBER>10</LINENUMBER>
    <MATERIAL>mat 1</MATERIAL>
    </PACKAGING_ITEM>
    </ROW>
    <ROW>
    <PACKAGING>
    <HU_LABEL>789</HU_LABEL>
    </PACKAGING>
    <PACKAGING_ITEM>
    <LINENUMBER>20</LINENUMBER>
    <MATERIAL>mat 2</MATERIAL>
    </PACKAGING_ITEM>
    </ROW>
    </DOCUMENT>
    <u><b>Target Structure</b></u>
    DOCUMENT 1..1
    ROW 1..unbounded    
    PACKAGING 1...1
    HU_LABEL 1..1
    PACKAGING_ITEM 1..1
    LINENUMBER 1..1
    MATERIAL 1..1
    Note, 1 ROW in the target structure = 1 HANDLING_UNITS from the source structure.
    Can anyone help me to achieve this? I do not know how to map the relevant DELIVERY_LINEITEM\MATERIAL from the source structure to the target structure.

    JM,
    Please find the solution. Reply back if it helps or not
    http://www.flickr.com/photo_zoom.gne?id=1045178998&size=o
    http://www.flickr.com/photo_zoom.gne?id=1045179010&size=o
    http://www.flickr.com/photo_zoom.gne?id=1045179022&size=o
    Results :http://www.flickr.com/photo_zoom.gne?id=1045179134&size=o
    <b>Code used:</b>
    for(int j=0;j<Handling_Linenum.length;j++)
    for(int k=0;k<Delivery_Linenum.length;k++)
    if(Handling_Linenum[j].equals(Delivery_Linenum[k]))
    result.addValue(""Material[k]"");
    result.addContextChange();
    Best regards,
    raj.

  • I created a website and a phone version with Adobe Muse. In order to add schema tags, I downloaded Dreamweaver and edited the website. Will these tags remain if I edit the site with muse again? Does Dreamweaver have to download the phone layout separately

    Also, I want to add Schema tags to the Muse master page copy, particularly serviceArea tags, but I'm not seeing the elements in Dreamweaver. Where are elements from the master found in Dreamweaver?

    Hi,
    I checked the first site, and there is no phone/tablet layout. On My phone, you desktop version appears fine.
    regarding second site, I see the phone layout with template content, so I doubt, if you have deleted the phone layout folder from the server, but did not delete the layout in Muse file. Hence when you publish the site again, the folder was created again.
    could you please confirm this, so I can test it further.

  • AirPort Express: Help with terminology

    Hi all,
    I've read lots of great posts here, but the terminology isn't always consistent, and I need help understanding the difference between the products.
    I would like to buy an AirPort Express base station (ie: router) and stream audio to two different rooms.
    Now, the AirPort Express is the remote device I would plug into the wall, right?
    From what I understand, I can buy an base station which comes with the remote device. If I want to buy a second remote device, what should I do a search for?
    Appreciate any feedback. Sorry for the newbie style question.
    Steve

    Checkout KB 107908, Identifying AirPort hardware.
    The base station is that "flying saucer" like device Apple sells, right?
    Those have been discontinued. The "flying saucer"s that Apple has sold in the past are the graphite 802.11b AirPort base station (ABS), dual Ethernet (snow) ABS, and 802.11b/g AirPort Extreme base station (AEBS).
    There's a smaller device that plugs into the wall, and has an ethernet port and an audio output. Right so far?
    I believe you are referring to the AX. Don't let its small size and shape fool you. It is also a base station.
    If so, what are these devices called? I'd like to buy the router and two of the remote devices with audio outputs.
    If all of your computers are connecting wirelessly, you can buy 3 AX.
    If any of your computers need to connect viaEthernet, you need an AEBS and 2 AX.

  • With the newest version of Firefox, I can no longer use the Google toolbar! Also, some of my Webroot protection had to be inactivated. When will these features be able to be used with Firefox again?

    With the new version of Firefox, the Google toolbar and something with my Webroot protection had to be inactivated to install. I use many of the features on the Google toolbar daily, and miss not being able to use it. When I try to reinstall, the message is that it is incompatible with Firefox 5.0. And I am not sure which features of my Webroot protection had to be deactivated for Firefox to install and run, but I want to retain my firewall and virus protection. And I MUCH prefer to use Firefox! So - I know you are always developing and improving. When will these become compatible again with Firefox.

    The Google Toolbar is from Google and support for it can only come from Google, and Google has eliminated it from Firefox, and it never was in Google. Even Google has indicated that the features are available in Firefox through other extensions. But the features are really available in Firefox even without extensions from what I've seen because Firefox has very powerful bookmarks and knowing how to use them with JavaScript, substitution, and keyword shortcuts is a key to using Firefox.
    '''The Google Toolbar is no longer supported by Google in Firefox 5 and up''', you may be able to get what you want from it for a limited time, the directions to install the Google Toolbar were posted before Google actually announced dropping support.
    *Enable Google Toolbar in Firefox 5<br>http://googlesystem.blogspot.com/2011/06/enable-google-toolbar-in-firefox-5.html
    *the-edmeister posted a brief evaluation of the situation<br>https://support.mozilla.com/en-US/questions/841736
    In any case you can find several alternative solutions, and you can start working on them now, see
    * "'''Using Google Toolbar features without toolbars'''" <br>http://kb.mozillazine.org/Using_Google_Toolbar_features_without_toolbars

  • Illustrator CC won't scale with "transform again"

    Coming from CS6, this is a feature I used all the time. However when I scale an object in CC and use transform again (Ctrl + D) to repeat the transformation on another object, it ignores the scaling and just repeats the most recent translation ie. it just moves the object rather than resizing it.
    I don't even know where to start to fix this, any ideas?

    pigeonbreath,
    Unless it has changed (you may have a look at the Object>Transform first option), it may be time for the list.
    The following is a general list of things you may try when the issue is not in a specific file (you may have tried/done some of them already); 1) and 2) are the easy ones for temporary strangenesses, and 3) and 4) are specifically aimed at possibly corrupt preferences); 5) is a list in itself, and 6) is the last resort.
    If possible/applicable, you should save curent artwork first, of course.
    1) Close down Illy and open again;
    2) Restart the computer (you may do that up to 3 times);
    3) Close down Illy and press Ctrl+Alt+Shift/Cmd+Option+Shift during startup (easy but irreversible);
    4) Move the folder (follow the link with that name) with Illy closed (more tedious but also more thorough and reversible);
    5) Look through and try out the relevant among the Other options (follow the link with that name, Item 7) is a list of usual suspects among other applications that may disturb and confuse Illy, Item 15) applies to CC, CS6, and maybe CS5);
    Even more seriously, you may:
    6) Uninstall, run the Cleaner Tool (if you have CS3/CS4/CS5/CS6/CC), and reinstall.
    http://www.adobe.com/support/contact/cscleanertool.html

  • Xfce4 - problem with fonts again... (especially k3b)

    hi,
    i did a base install from the arch widget iso 0.6 and used pacman to
    install everything i need. i use xfce4.
    after installing licq i noticed the same font problem writen sevarel times in this forum (big  font with large spaces) but in the options of licq i could change these fonts, now it looks ok.
    later i installed k3b because i was told that k3b is the easiest burner tool linux has to offer.
    again this font problem (2nd time) but this time there was no font option in k3b settings/otion/menu .......
    i read the "crummy fonts in kde" thread and followed all the tips... no results, fonts changed here and there but NOT in k3b!!!
    in another thread in this forum someone postet a screenshot of his k3b...
    my k3b looks 100% the same :-/
    but as i can remember the problem was not solved.
    what i want is to change this font or another good and easy burning tool :-)
    thanks for every help!
    greeting matto

    matto wrote:...i noticed the same font problem writen sevarel times in this forum (big  font with large spaces) but in the options of licq i could change these fonts, now it looks ok.
    later i installed k3b because i was told that k3b is the easiest burner tool linux has to offer.
    again this font problem (2nd time)...
    Check out this thread for help with XFCE4 fonts:
    http://bbs.archlinux.org/viewtopic.php?t=5021
    just read past the beer talk toward the bottom.
    In my experience, large fonts have to do with improper DPI settings.  The best match is to find out what your resolution is, and then set your DPI to the horizontal DPI setting, as shown below (for mine):
    xdpyinfo | grep resolution
    resolution: 87x90 dots per inch
    I set my DPI to 87 (the horizontal) and all is proportional.  You can also adjust the DPI settings to make the screen to the proper 4:3 aspect ratio.  For some reason, the NVIDIA driver kinda fubars it a bit, and I have to manually adjust it with certain resolutions.  I discuss how to compute those numbers in that thread as well.

  • Trouble with streaming AGAIN

    Hi there,
    I thought the problem was solved. But since today I have the same problems. If I try to stream some content from hulu.com is says: "sorry, but it works not on your platform".
    thus I started all over again:
    http://discussions.apple.com/thread.jspa?threadID=2427934&tstart=0
    I even installed a new flash player - nothing works.
    please help!
    Cheers
    Jan

    Ok.....
    We tried this before on your first topic and it may have helped... try this one more time.
    Go to ~/Library/Caches/com.apple.Safari/ Move the Cache.db file to the Trash and restart your Mac.
    The issue with Adobe and Flash is that anytime you uninstall then reinstall the Flash Player plugin Adobe requires that you repair permissions. That's why I mentioned it again... I understand how this can be exasperating... I really do.
    One more idea. Download and install the v10.6.3 Combo Update It's ok to do this even though you are already running v10.6.3. The combo includes fixes that were not part of the v10.6.3 original update.
    According to the information regarding the DIVX player here http://support.divx.com/faq/view/supportFAQen037/System-Requirements-DivX-for-Ma c
    There isn't any information stating that it supports Snow Leopard, only 10.4+ which does not necessarily mean 10.6.
    It's possible that the DIVX player is causing an incompatibility issue. Try removing it from your hard drive, restart your Mac and see if you can use Hulu.
    If Safari crashes, please post a crash report.
    Open Finder.
    Click "Go" in the menu, then select "Go to Folder".
    Copy and paste this path into the Finder dialog:

    ~/Library/Logs/CrashReporter/
    Click the Go button.
    Finder opens the folder containing the crash log. Look for a the crash file with a date field that looks like *the most recent.*

  • Solving easy as abc puzzle with python - License question

    Hi everyone, I have just posted something about solving puzzles by programming and thought you could find it interesting. It is on http://arkocal.blogspot.com/2012/11/puz … s-abc.html
    My question is, which licence fits such educational code? Thanks for any help and opinions.

    I agree with Nisstyre56 that you'll want to pick a license that has been thoroughly vetted by lawyers (who hopefully specialize in intellectual property). I've come across some interesting custom software licenses (CRAPL is particularly amusing), but they'll do little more than communicate your wishes.
    Creative Commons (CC) licenses are great for protecting self published creative works (e.g. artwork, music, personal websites, instruction material, etc). However, they should not be used for software (see Creative Commons FAQ). There are a lot of technicalities associated with licensing software; many of which derive from the numerous forms in which "software" can exist on a machine and be distributed. For example, if you distribute your source code under a CC license, and then the end user compiles it on their machine using their compiler, do the terms of the original license still apply to the machine code (or byte code)? If so, in what sense? What about linking to other libraries under a different license? Specialized software licenses (e.g. MIT, BSD, GPL, Artistic Licences, etc) address these issues. See OSI for a description of many open source software licenses.
    When selecting a license, you should be mindful of the difference between a copyright and a copyleft license. Roughly speaking, a copyright license (e.g. MIT) allows for derivative work to be put under a different license, whereas a copyleft license (e.g. GPL) requires all derivative work to be put under the same license. Both can have important long term implications. For example, if you release your project under a copyright license, then you may find yourself competing against a proprietary fork of your own project. If you choose a copyleft license, you may have difficulty reusing your work in projects that require a different license.
    Based on what I saw on your blog, I didn't see any links to any source code. All I see is a tutorial with code snipets. As far as the tutorial is concerned, I would expect the CC license to be sufficient. If you're planning to release small, example ("toy") programs, then I would expect that any license that provides denial of warranty and liability to be sufficient. However, if you want attribution for your work (e.g. if someone uses your source code in their own blog), then I would expect that you may want to seek something more specialized.
    I am not a lawyer. My reply does not constitute legal advice.
    Last edited by bsilbaugh (2012-11-13 04:07:43)

Maybe you are looking for

  • Actual cost of Production Order settled to Fixed Assets

    Dear all, My client is doing in-house production of moulds (internal order suggestion is not accepted by the client) for which they have the following 1. BOM 2. Machine hour 3. labour 4. overhead etc 5.plan value 6. actual value Can i settle the actu

  • HDD Problem from Boot Camp

    Hey, I just got some problems trying to set up Boot Camp. On my MacBook, I have a good amount of HDD space used about, with about 60gbs left. So I wanted to set it up so that half of that would go to the new Windows partition. So I set that up, it pa

  • JSF, Creator and WML

    Hi, I would like to know how to render a JSF page with WML rendering. is it possible to produce such thing with Creator ? Is it necessary to use a specific tld ? Best regards R�gis

  • Retreiving a set of records

    Hello I'm a newbie and i have to make a procedure that can return a set of records , in Transact SQL I make using temporal tables , is possible to do the same in Oracle ? Thanks

  • How to run commands like "ipconfig" and get the output in adobe AIR in windows?

    import flash.desktop.NativeProcess;  import flash.desktop.NativeProcessStartupInfo;    if (NativeProcess.isSupported) {           var npsi:NativeProcessStartupInfo = new NativeProcessStartupInfo();           var processpath:File = File.applicationDir