Error message:can't convert int to int[]

Hi,
I am trying to build a java code which convert decimal to binary
but ,I found error message "can not convert int to int[]"
some line of code:
int i=12,n=0;
int arr[n]=i%2;
n++;
here I am trying to store remainder in an integer arrary.
how can i do this???????
guide me please
-shobhit singh

shobhit_onprob wrote:
i want to store some integer values in to an integer arraryDid you follow the address that was given to you? I doubt it, and even if you did, 2 minutes is not enough time to read, let alone understand, the tutorial.
Go back there, it describes all the basics you need.

Similar Messages

  • Can't convert int to int[]    URGENT!

    HI list!
    Here is the code part I have:
    /** Holds the permutated groups which are arrays of integers. */
    Vector v;
    if(arg.length<3) System.exit (0); //Need at least 3 arguments
    elements=new int[arg.length-1]; //Create array to hold elements
    /* Copy the arguments into the element array. */
    for(i=0;i<arg.length-1;i++) elements=Integer.parseInt(arg[i+1]);
    groupsize=Integer.parseInt(arg[0]); //Get the number in each group.
    calc(groupsize,elements.length); //Find out how many permutations there are.
    v=permutate(groupsize,elements); //Do the permutation
    for(i=0;i<v.size();i++) { //Print out the result
    elements=(int[]) v.get(i);
    System.out.println("");
    for(j=0;j<elements.length;j++) System.out.print(elements
    [j]+" ");
    System.out.println("\nTotal permutations = "+v.size());
    and the error I get is:
    Permutate.java:26: Incompatible type for =. Can't convert int to int[]. for(i=0;i<arg.length-1;i++) elements=Integer.parseInt(arg[i+1]);

    elements=(int[]) v.get(i);
    The above statement is illegal. Its not possible to
    use an array type in casting at all.
    Basically you are trying to do a kind of multiple
    casting, which is not possible.
    You might want to store vectors in vector v instead of
    arrays in vector v. Its better to do this.There's nothing wrong with the line
    elements = (int[]) v.get(i);
    assuming the returned object from the vector is in fact an array of int. Even then, it is a runtime exception condition not a compile-time error.
    Using arrays is perfectly valid where you know the size of the array at creation and do not need to resize it during use... The arrays are fast and compact. This is however not a comment on the approach taken in this case but merely an observation that arrays are not always an inferior choice to one of the collection classes.
    Now put up your dukes... ;)

  • Can't convert int to java.lang.Integer.

    Hi everyone.
    I'm working on an auction site at the moment and have problems gaining a bidID number. This is part of my code and my error.
    AuctionFacade aHse = (AuctionFacade) application.getAttribute("AuctionFacade");
    String strTraderName = (String)session.getAttribute("traderName");
    String strPassword = (String)session.getAttribute("password");
    String strIDNum = request.getParameter("auctionID");
    Integer intID = Integer.valueOf(strIDNum);
    Integer [] bids = aHse.getAllBids(intID);
    float fltYourBid = aHse.getBidPrice(bids.length);
    ^
    Can't convert int to java.lang.Integer.
    can anyone help please?

    So, does "aHse.getBidPrice" expect an int or an Integer as its parameter? And does it return an int, or an Integer, or what? The answer to those questions may lead to your solution -- look at what you are actually using as the parameter, for example.

  • Can't convert int to java.lang.Object

    When I deploy my customer Bean, the following error occures, I think the main problem is Can't convert int to java.lang.Object, does anyone facing the same problem with me?
    <pre>C:\j2sdkee1.3\repository\home\gnrtrTMP\CustomerApp\CustomerBean_RemoteHomeImpl.j
    ava:27: Incompatible type for declaration. Can't convert int to java.lang.Object
    java.lang.Object primaryKey = ejb.ejbCreate(param0, param1, para
    m2);
    ^
    C:\j2sdkee1.3\repository\home\gnrtrTMP\CustomerApp\CustomerBean_RemoteHomeImpl.j
    ava:57: Incompatible type for =. Can't convert int to java.lang.Object.
    primaryKeys = ejb.ejbFindByPrimaryKey( param0);
    ^</pre>
    I really need your help!!!

    you can only convert one object type to another. Integer is an object int isnt. You might want to convert int to Integer and then go ahead.
    see if it works.

  • Error Message:Can't print illustration. Color Management systems inconsistent.

    I am getting this error message, "Can't print illustration. Color management systems are inconsistent." I just upgraded to CS5(from CS2) on a Dell Studio using an Epson WorkForce 1100 or an Epson Sylus NX400. I am a rank amateur in AI & have no idea how to fix this. I do not seem to have the option to turn off color management in either of my printers to default to AI. All I am trying to print are some labels using regular fonts and a few smoke brushes for color. These are not wildly colorful or complicated. I KNOW I should be using a Mac but I do not have one...sigh...
    Thanks for ANY help.
    Marion.

    not sure I understand the core problem...but what happens if you Save As "Adobe PDF" and Convert to your Print Space there in Output (then print from Acrobat or place in InDesign, heck maybe even open the .pdf in Ai and try again):

  • Error Message in Word  Convert To PDF Tab

    I am gettting an Error Message in Word  Convert To PDF Tab
    The pop up box comes up when I am in Word 2003 , it says "Unabkle To Find PDFresource files, you must be an adminstrator to install these files
    So I cannot create a PDF file when in Word 2003
    When I go to Acrobat  9.0 and try to create from a file , choose the word file, it says it is creating it- but nothing happens, its like it's not loading.
    I am on a PC

    Can you print to the Adobe PDF printer (I suspect you can not)? Are you logged in as the administrator? Can you find any of the job settings files? If the latter is the case, then you likely do not have permissions set to allow you to read the folder that has all the job settings. If you are not the administrator, you will have to get the administrator to find the folder (it is in one of the document and settings folders under Adobe for XP and under the Users (I think) on Win7) and grant you access.

  • Envy 5534 on MAC- print error message unable to convert post scrip file

    New printer set up fine prints letter but when I want it to print a page with bar code on get error message :-
    print error message unable to convert post scrip file
    Can any one help please
    This question was solved.
    View Solution.

    Hi @itsalex,
    What type of bar code are you printing, and from what program? Just a thought, what if you print the barcode as an image, if you are not already? Try File>Print> Advanced> Print as Image> print.
    If the issue persists, let's reset the printing system and repair the disk permissions; doing so may resolve the issue.
    Reset Printing System
    Click the Apple icon ( ), and then click System Preferences.
    In the Hardware section, click Print & Fax/Scan. The Print & Fax/Scan dialog box opens.
    Right-click (or Ctrl +click) in the left panel, and then click Reset printing system…
    Click OK to confirm the reset.
    Type the correct Name and Password.
    Click OK to reset the printing system. The Print & Fax dialog box shows no printer selected
    Note: This will remove all printers in the print and Fax/Scan, any printer removed can be re-added later by clicking the plus (+) symbol.
    Repair Disk Permissions
    On the Dock, click Applications, and then click Utilities.
    Double-click Disk Utility.
    Highlight your hard drive/partition on the left (by default this is "Macintosh HD").
    Click the Repair Disk Permissions button at the bottom of the window.
    Once the repair is complete, restart the computer and add the printer back.
    When you add the printer, please ensure you are using the HP driver.
    Select Add other Printer or Scanner 
    Select the printer you are adding and next to 'Use' you can select the printer drive. In the screenshot below, you will see Airprint is auto selected, you can change it to the HP driver though.
    I look forward to hearing back from you.
      Talk to you later alligator 
    Please click the Thumbs up icon below to thank me for responding.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Sunshyn2005 - I work on behalf of HP

  • HT4623 Please help I I have updated pc win 8, update itunes and i can open and access all in icould but my reminders will not load error message can't load reminders

    I can not open my reminders in icloud, error message can't load reminders.  Have hp win 8 and all has been fine until today for over a year. win updates are done and itune updates done, what should I do?

    Try this  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased.
     Cheers, Tom

  • Just got new air and trying to set up. When I put in my Apple ID and password it comes up with error message 'can't sign in because of server error. Try again signing on.' Trying again does not fix. I know my ID and PW are right as work on other devices.

    Just got new air and trying to set up. When I put in my Apple ID and password it comes up with error message 'can't sign in because of server error. Try again signing on.' Trying again does not fix. I know my ID and PW are right as work on other apple devices I have.

    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime: Set-up, Use, and Troubleshooting Problems
    http://tinyurl.com/32drz3d
     Cheers, Tom

  • I can't update itunes. I get error message can't find "itunes.msi". What can I do?

    What can I do to download updated itunes. I get error message can't locate "itunes.msi." folder.

    Unfortunately, this sort of trouble has gotten more complicated to deal with ever since Microsoft pulled the Windows Installer CleanUp utility from their Download Center. First we have to find a copy of the utility.
    Let's try Googling. (Best not to use Bing, I think.) Look for a working download site for at least version 3.0 of the Windows Installer CleanUp utility. (The results from mydigitallife and Major Geeks are worth checking.)
    After downloading the utility installer file (msicuu2.exe), scan the file for malware, just in case. (I use the free version of Malwarebytes AntiMalware to do single-file scans for that.)
    If the file is clean, to install the utility, doubleclick the msicuu2.exe file you've downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove".
    Quit out of CleanUp. Restart the PC, and try another iTunes install. Does it go through properly this time?

  • Getting error message can't open unistalled product

    Cant open itunes ... getting error message can't open uninstalled product.... can't uninstall..  help

    Doublechecking before proceeding. Is that a "This action is only valid for products that are currently installed" error message?

  • When I try to open contacts from the icloud control panel on my windows 7 PC, I get an error message: can't load contacts. There was a problem loading the application.

    When I try to open contacts from the icloud control panel on my windows 7 PC, I get an error message: can't load contacts. There was a problem loading the application.

  • I keep getting error message, "can't open application PACE because PowerPC applications are no longer supported." I've run Clean My Mac and I still get the error.

    I keep getting error message, "can't open application PACE because PowerPC applications are no longer supported." I've run Clean My Mac and I still get the error.

    Use the Finder "Go" menu while holding down the option key to expose your User / Library folder.
    Look in the Application Support folder for PACE items and delete them.

  • Error message: "Can't open file"

    Using Keynote 3.0.x I try to open a keynote file created a year ago and when I try to open the "Opening" dialog comes up, you see the progress bar, and then, I get the error message, "Can’t open file" followed by the file name. Any recourse?
    PowerMac G5   Mac OS X (10.4.7)   FInal Cut Pro 5.1

    I later discovered the file was damaged. Went back to a backup copy and things were fine. Good think we have backups.

  • My computer crashed necessitating re-install of op sys and all programs including iTunes. At the iTunes store when I click a song in my library get error message "can't find, do you want to search?" What's happening? How can I listen to my library on this

    My computer crashed necessitating re-install of operating sys and all programs including iTunes. When I click on a song in my library I get an error message "can't find this song, want to search?" What gives? How can I listen to songs in my library on this computer now?

    It is working now. I no longer get the message about the item not being available in the US and I can access the store.

Maybe you are looking for

  • Adobe Photoshop CS6 Extended - 3D Disabled

    Hello folks how do you do? Well, I'm experiencing a problem using the 'Adobe Photoshop CS6 Extended'. In general the 3D feature doesn't really show up in my screen. What can I do? Please some one? Here's my System info: Adobe Photoshop Version: 13.0

  • Custom JAAS login module configuration in Oracle application server

    I have a LDAP login module implementing javax.security.auth.spi.LoginModule. This login module works well with tomcat and weblogic, if I configure the JVM arguments -Djava.security.auth.login.config and -Djava.security.policy to point to the login.co

  • "There is a problem with the SIM card in your iPhone"

    I'm getting this error when I try to activate my new iPhone 4 through iTunes: "*There is a problem with the SIM card in your iPhone.* To activate your iPhone with this account, you will need a new, unactivated SIM card. Please use the SIM card that w

  • Apps not installing

    I just bought the brand new MacBook Pro 13'inch (jan 2012) and i cant seem to install any apps on it . When i click Install App, the loading cirlce just keeps spinning and nothing happens! Is there more to installing an app?

  • CSM v4: Internal error Exception updating Policy: PG. PLATFORM.Pix.AuthenAuthorPage

    HI, someone could help me.. i have this problem in CSM v 4..when add Cisco ASA 5505 ..IOS 8.3 "Exception u´dating policy:PG. I had tried to add like ASA device and PIX device. but i cant....Someone could help me .. Thank ...Marco..