What is the Problem in the way that I get input into an Array

Hi Guru's,
Im learning Java and I have written a simple program to get the input and write into an Array. The program is as follows.
import java.util.*;
public class ArraysSort {
     public static void main(String[] args)
          System.out.println("Enter the Number of Entries that you want to Enter");
          Scanner num = new Scanner(System.in);
          int len = num.nextInt();
          int arr[] = null;
          System.out.println(len);
          System.out.println("Enter the Numbers");
          for (int i=0;i<len;i++)
*               *arr[i] = num.nextInt();*
          //System.out.println("The Numbers in Ascending Order are:");
          //Arrays.sort(arr);
          for (int i=0;i<arr.length;i++)
               System.out.println(arr);
Can anyone tell me what is wrong with the Way that I get the input. I have marked the statement in Bold for easy identification.
Thanks a lot for all your help..

VijaySwaminathan wrote:
*               *arr[i] = num.nextInt();*I don't think you can just say
int arr[] = null;and then expect it to insert? Surely first create an array like this....
int arr[] = new int[len];

Similar Messages

  • I have an ipod nano 5th generation. the problem with it's that it doesn't show in itunes when connected to the laptop and it switches on on its own and songs start playing the battery gets consumed too fast after full charge. what is the actual problem?

    i have an ipod nano 5th generation. the problem with it's that it doesn't show in itunes when connected to the laptop and it switches on on its own and songs start playing the battery gets consumed too fast after full charge. what is the actual problem?

    What have you tried so far in terms of troubleshooting this issue?  Are you plugging the iPod into a high powered USB 2.0 port on the back of your PC? Have you tried a different USB cable?
    What happens if you try to reset the device with it still connected to the PC?
    How to reset iPod
    Has this iPod ever worked on this PC or is this the first time you have time you have tried connecting it?
    Have you carefully worked through each and every single suggestion in this Apple support document?
    iPod not recognized in 'My Computer' and in iTunes for Windows
    B-rock

  • HT1338 what about the problems with the trojan virus is that a problem for my mac as well?

    What about the problems with the Trojan virus will this be a problem also for me using Mac

    What Trojan?
    If you're referring to the DNS Changer Trojan, it's highly unlikely you're affected. The actual distribution of the trojan was stopped several years ago and the perpertrators jailed.
    The FBI has been maintaining the servers used by the trojan for the last 5 years in order to give affected systems time to be purged. They will finally shut them down on Monday.
    Ensure that your router and the Mac's network settings are set for the DNS addresses of your ISP, or if you're not sure what they should be, change them to Open DNS using the IP addresses;
    208.67.222.222
    208.67.220.220

  • Is there a way to adjust the settings on launchpad so that when I swipe into it all the open apps/pages are fully separated (like in exposé) so that I can fully view all of them simultaneously?

    Hi Apple community,
    This is my first go at this so be kind,
    My question concerns launchpad. Coming from Snow Leopard I had been using spaces. I like to keep certain bundles of programs on separate desktops, for example all word processing related tasks in one place. I have set up the equivalent on Yosemite.
    My problem is concerns the loss of exposé. Now I know when you swipe into launch pad you get a very similar effect but the issue I am having concerns the "zoom out" effect when you swipe into launchpad. With exposé all open apps/pages etc would be fully exposed - in my case several (sometimes as many as 9 word documents). What I am running into is when I do this in / into launch pad the "pile" of docs is exposed but they are still overlapping so I can't get a good look at which is which and visually identify where I want to navigate to.
    My question is this; Is there a way to adjust the settings on launchpad so that when I swipe into it all the open apps/pages are fully separated (like in exposé) so that I can fully view all of them simultaneously? If so, instructions on how to do so would be greatly appreciated. Any alternative suggestions to doing this outside of launchpad are also welcome. If there is an exposé app for example, I would be quite willing to go that route.
    My main concern is being able to quickly (ie a touchpad gesture) expand all the open pages so I can bounce between them.
    Much thanks from a loyal Apple friend.

    Hey Eric,
    Thanks for taking the time. Unfortunately no that does not solve it. Same as swipe it will get me there and it will show separate programs spaced out. The issue I am having is that all my open word files are bunched up in a pile on top of each other. I can see the edges of each one but I want them to be separated from each other enough that I can visually identify what file is what.
    Again, thanks for trying, it is appreciated.

  • I cant use the highlight, underline, or strikethrough function in a specific pdf file. The file isnt locked. I used to highlight texts from that file before the latest update. The problem occurs only with that file. Urgent need. Please help. Thanks!

    i cant use the highlight, underline, or strikethrough function in a specific pdf file. The file isnt locked. I used to highlight texts from that file before the latest update. The problem occurs only with that file. Urgent need. Please help. Thanks!

    Chester31,
    Thank you very much for sharing your file with us!  Now that we are able to reproduce the problem at our end, you may stop sharing the file on Acrobat.com.
    Do you know when this problem (for not being able to add new highlight/strikeout/underline) has started?  Did you update your iOS from 7.x to 8.0 recently?
    We will continue investigating the problem and let you know what we find.
    Thank you again for your help.

  • TS1398 my iphone 4s can not scan any wifi network, i tried everything but still can not scan any wifi connection even though our wifi is working properly in our mac book and ipad. What do i need to do if the problem is the hardware?pls help

    my iphone 4s can not scan any wifi network, i tried everything but still can not scan any wifi connection even though our wifi is working properly in our mac book and ipad. What do i need to do if the problem is the hardware?pls help

    When you say it "can not scan any wifi network" do you mean it is not detecting Wi-Fi networks?
    Is Wi-Fi turned on in Settings > General > Wi-Fi?
    Have you tried Settings > General > Reset > Reset Network Settings?
    Is it just the home network that the device will not connect to? or any network?

  • TS1702 I just upgraded a full version of "ISO Fits" app from App Store 2 days ago but the upgrade wasn't successful. I reported the problem to the developer but had not received any reply. What should I do?

    I just upgraded a full version of "ISO Fits" app from App Store 2 days ago but the upgrade wasn't successful. I reported the problem to the developer but had not received any reply. What should I do?

    1. You did not get an error message telling you that your iPhoto library was getting full. You got a message telling you that your HD was getting full, right?
    OS X needs about 10 gigs of hard drive space for normal OS operations - things like virtual memory, temporary files and so on.
    Without this space your Mac will slow down as the OS hunts for space on the disk, files will be fragmented, also slowing things down, apps will crash and the risk of data corruption - that is damage to your files, photos, music - increases exponentially.
    Your first priority is to make more space on that HD. Nothing else can be done until you do.
    Purchase an external HD and move your Photos and Music to it. Both iPhoto and iTunes can run perfectly well with the Library on an external disk.
    Your Library has been damaged from being run on an overfull disk.
    How much free space on it now?

  • I allowed Apple updates about two weeks ago and now Safari is way too slow.  I have tried using Airport and Ethernet and the problem is the same.  Yesterday, I updgraded to Safari 5.1 and the problem is now worse.  Any solutions?

    I allowed Apple updates about two weeks ago and now Safari is way too slow.   I have tried using Airport and Ethernet and the problem is the same.  Yesterday, I upgraded to Safari 5.1 and now the problem is worse.  Any solutions?

    I can't stand peremptory affirmations like "Nothing is wrong with Safari".
    Thousands of users can't be wrong (see the discussions).
    If I read you the right way, it's never software' fault, it's the user who's the culprit.
    Amazing!
    In this very case, the fact is we can't give to "christinefromfonthill" a good solution because weren't sitting in front of her Mac.
    You give her a good advice which could, perhaps, lead to an improvement.
    But must also admit that Safari is a very slow browser compared to Firefox or Chrome.
    And you can't ignore all the problems which arose when upgrading to Lion and were related to the new build and specs of Safari 5.1.
    The best example is the apparition of "garbage type" (use of Last Resort font) when reading numerous sites. This never occured before and is the direct consequence of Safari compliance to Web Open Type. This standard prohibits the use of Type 1 Postscript Fonts and is the reason why so many people are in trouble.
    I use a Mac for more than 25 years.
    I am a very "clean" user who hates the bells and whistles of third party.
    My Mac is always up-to-date and despite all my Mac loving care, I run into some problems.
    Imagine the nightmare which can occurs for the vulgum pecus who isn't, by definition, a power user aware of all the requirements for running a System in optimal conditions.
    May be Safari is one step in advance on its time but lambda users are paying the price for it.

  • What's the problem with the .f4m file?

    f4m file content(not work):
    http://localhost:10009/UploadFiles/Video/Video/20128/201208141534459942.f4m
    <?xml version="1.0" encoding="UTF-8"?>
    <manifest xmlns="http://ns.adobe.com/f4m/1.0">
      <id>Dynamic Streaming</id>
      <duration>59</duration>
      <mimeType>video/x-flv</mimeType>
      <mediaType>recorded</mediaType>
      <baseURL>rtmp://testserver/vod</baseURL>
      <media url="Video/Video/20128/201208141534459942_480x320_15fps_360kbps_flv" bitrate="360" width="480" height="320"  />
      <media url="Video/Video/20128/201208141534459942_640x480_15fps_768kbps_flv" bitrate="768" width="640" height="480"  />
      <media url="Video/Video/20128/201208141534459942_1280x720_15fps_1500kbps_flv" bitrate="1500" width="1280" height="720" />
    </manifest>
    The invidual file(work):
    rtmp://testserver/vod/Video/Video/20128/201208141534459942_480x320_15fps_360kbps_flv
    The invidual file's extension is ".flv",  what need i to modify to make the f4m file worked?

    In addition to the previous answers, the problem with the Seagate HD's involved in the recall is that they have a very high failure rate, to the extent that Apple expanded the recall to cover more computers than it initially did. For example, a user on Macintouch (another online Mac support community that is well worth checking out) reported that his company bought 40 iMacs and 25 of them needed their 1TB Seagate drives replaced.
    So if you can, get somebody with access to your computer to backup its HD as soon as possible if you don't already have a full backup.

  • What's the problem with the URL

    Someday when I entered an URL into IE browser, I typed like http://greatsite./greatday. Unfortunately, after that, every time when I enter a URL into IE like http://greatsite/someday, it will change to http://greatsite./someday automatically, then the error page below is followed. What's the problem?
    The web server is IBM HTTP Server or Apache web server. Not just with my box, any other machines have the same problem with http://greatsite. How can I correct this problem?
    Any help would be great!
    The error page:
    11001 Host was not found
    The host specified in your URL could not be found.
    This error could have been caused by:
    Bad / misspelled URL
    Following an invalid link
    Your network connection and/or transient conditions on the Internet

    There are other browsers you could use.

  • How do I Help Apple Care Stop Warring with Each Other and Fix the Problem with My iPhone that They Acknowledge Creating?

    How Do I Help Apple US & Apple Europe Stop Warring With Each Other And Fix The Problem They Created?
    PROBLEM
    Apple will not replace, as promised, the iPhone 5 (A1429 GSM model) that they gave me in London, UK, with an iPhone 5 (A1429 CDMA model).
    BACKGROUND
    My iPhone 5 (A1429 CDMA model) was purchased this year in September on an existing Verizon Wireless (VZW) line using an upgrade. The purchase took place in California and the product was picked up using Apple Personal Pickup through the Cerritos Apple Retail Store. I will refer to this phone at my "original" phone.
    The original phone was taken into the Apple Store Regent Street in London, England, UK on November 15, 2012. The reason for this visit was that my original phone's camera would not focus.
    The Apple Store Regent Street verified there was a hardware problem but was unable to replace the part.
    The Apple Store Regent Street had me call the US AppleCare. At first they denied support, but then a supervisor, name can be provided upon request, approved the replacement of my original phone with an iPhone 5 (A1429 GSM model) as a temporary solution until I got back in the US. And approved that the GSM model would be replaced with a CDMA model when I came back to the US. I will refer to the GSM model as the "replacement". They gave me the case number --------.
    The Apple Store Regent Street gave me the replacement and took the original. The first replacement did not work for reasons I do not understand. They switched out the replacement several times until they got one that worked on the T-Mobile nano SIM card that I had purchased in England, UK. Please refer to the repair IDs below to track the progression of phones given to me at the Apple Store Regent Street:
    Repair ID ----------- (Nov 15)
    Repair ID ----------- (Nov 16)
    Repair ID ----------- (Nov 16)
    The following case number was either created in the UK or France between November 15 to November 24. Case number -----------
    On November 19, 2012, I went to France and purchased an Orange nano SIM card. The phone would not activate like the first two repair IDs above.
    On November 24, 2012, I went to the Apple Store Les Quatre Temps. The Genius told me that my CDMA phone should not have been replaced with a GSM model in the UK and that this was clearly Apple's fault. They had me call the AppleCare UK.
    My issue was escalated to a tier 2 UK AppleCare agent. His contact information can be provided upon request. He gave me the case number -----------.
    The UK tier 2 agent became upset when he heard that I was calling from France and that the France Apple Store or France AppleCare were not helping me. He told me that my CDMA phone should not have been replaced with a GSM model in the UK and that this was clearly Apple's fault.
    The UK tier 2 agent said he was working with engineers to resolve my problem and would call me back the next day on November 25, 2012.
    While at the Apple Store Les Quatre Temps, a Genius switched the phone given to from repair ID ----------- with a new one that worked with the French nano SIM card.
    Also, while at the Apple Store Les Quatre Temps, I initiated a call with AppleCare US to get assistance because it seems that AppleCare UK was more upset that France was not addressing the issue rather than helping me. I have email correspondance with the AppleCare US representative.
    A Genius at the Apple Store Les Quatre Temps switched the replacement with a new GSM model that worked on the French SIM card but would not work if restored, received a software update, or had the SIM card changed. This is the same temporary solution I received from the Apple Store Regent Street in the UK.
    By this point, I had spent between 12-14 hours in Apple Store or on the phone with an AppleCare representative.
    Upon arriving in the US, I went to my local Apple Store Brea Mall to have the replacement switched with a CDMA model. They could not support me. He told me that my CDMA phone should not have been replaced with a GSM model in the UK and that this was clearly Apple's fault. My instructions were to call AppleCare US again.
    My call with AppleCare US was escalated to a Senior Advisor, name can be provided upon request, and they gave me the case number -----------. After being on the phone with him for over an hour, his instructions were to call the Apple Store Regent Street and tell them to review my latest notes. They were to process a refund for a full retail priced iPhone 5 64BG black onto my credit card so that I could use that money to buy a new iPhone 5 64GB black at the Apple Store Brea Mall to reoslve the problem.
    The Apple Store Regent Street did not process my refund. He, name can be provided upon request, told me that the AppleCare US did not do a good job reviewing my case, that they were incapable of getting to the bottom of it like they were, and instructed me to call AppleCare US and tell them to review this case number and this repair id. I asked if he read the notes from the AppleCare US Senior Advisor and he would not confirm nor deny. When I offered to give him the case number he accepted but it seemed like would do no good. Our call was disconnected. When I tried calling back the stores automated system was turned on and I could not get back through.
    Now I have the full retail price of an iPhone 5 64GB black CDMA on my credit card and Apple will not process the refund as they said they would.
    I've, at this point, spent between 14-16 hours at Apple Stores or on the phone with AppleCare representatives, and still do not have the problem resolved.
    SOLUTION
    AppleCare US and AppleCare Europe need to resolve their internal family issues without further impacting their customers.
    Apple is to process a refund to my credit card for the cost of a full retail priced iPhone 5 64GB black.
    DESIRED OUTCOMES
    I have an iPhone 5 (A1429 CDMA model) that works in the US on VZW as it did before I received the replacement phone in the UK.
    Apple covers the cost of the solution because I did not create the problem.
    Apple resolves their internal issue without costing me more time, energy, or money.
    This becomes a case study for AppleCare so that future customers are not impacted like I have been by their support system.
    Does anyone have recommendations for me?
    Thank you!
    <Edited by Host>

    Thanks, but I've been on the phone with AppleCare US (where I am and live) and AppleCare UK. They continue bouncing me back and forth without helping resolve the problem.
    Perhaps someones knows how to further escalate the issue at Apple?

  • I have a ipod classic 160GB , the problem with it is that it is dead no respond at all, i even tried to do a hard reboot, i tried to connect to itunes but it did not work, if somebody has a solution please let me know! the screen on the ipod shows nothing

    I have a ipod classic 160GB , the problem with it is that it is dead no respond at all, i even tried to do a hard reboot, i tried to connect to itunes but it did not work, if somebody has a solution please let me know! the screen on the ipod shows nothing........

    This is the iPod touch forum. I will request that you post be moved to the iPod Classic forum.

  • I have been creating forms in InDesign and pulling into Acrobat XI Pro to do form fields. My client would like to fill in the PDF form, save under a different name locally on their device, and redistribute. The problem I have is that, sometimes, they want

    I have been creating forms in InDesign and pulling into Acrobat XI Pro to do form fields. My client would like to fill in the PDF form using Reader, save under a different name locally on their device, and redistribute. The problem I have is that, sometimes, they want to redistribute the form as Read Only. I know how to flatten the form on a mobile device, but uncertain how they can do that with a PC or Mac using Adobe Reader. I looked at FormsCentral thinking there might be a solution going that route, but don't believe there is. Any advice?

    FormsCentral won't help with flattening a form. You could set up the form in Acrobat so that the fields are set to read-only, using JavaScript. Not quite the same as flattening but it's the best Reader can do.
    Note that when Reader is used to e-sign a document, it gets flattened, but this won't be possible if you need to Reader-enable the form and under certain other conditions.

  • After downloading the mac os x 10.6.8 I can't open safari. It first told me that I could not run it with Safari 5.1 so I downloaded safari 6 because I had read that that would solve the problem. However I am still getting an error message. HELP!!

    After downloading the mac os x 10.6.8 I can't open safari. It first told me that I could not run it with Safari 5.1 so I downloaded safari 6 because I had read that that would solve the problem. However I am still getting an error message. HELP!!

    I see this on Apple's support page:
    Available for: OS X Lion v10.7.5, OS X Lion Server v10.7.5, OS X Mountain Lion v10.8 and v10.8.1

  • HT1476 I have a big problem in my phone charger . I have Iphone 5s . I don't know what is the problem but the bettery is not working true . A decrease in the battery very quickly and then turns off the machine . Please, I want to address this problem quic

    I have a big problem in my phone charger . I have Iphone 5s . I don't know what is the problem but the bettery is not working true . A decrease in the battery very quickly and then turns off the machine . Please, I want to address this problem quickly .

    http://osxdaily.com/2013/09/19/ios-7-battery-life-fix/

Maybe you are looking for