Would appreciate some help with this.

Hello, I have a class that looks like this:
import extra.*;
public class Bokhylla {
int x;
public Bok[] b?cker = new Bok[x];
public Bokhylla(int antal) {
x = antal;
The problem is that I want x in my array to be set from the constructor, but the code above does not work. It doesn't matter how big "antal" is, when I try to set a reference to an object in position 0 in Bok[] the program complains that it is out of boundary.

Hello, I have a class that looks like this:
import extra.*;
public class Bokhylla {
int x;
public Bok[] b?cker = new Bok[x];
public Bokhylla(int antal) {
x = antal;
}You should move the Bok[] instantiation into the constructor after x is asigned the value of antal.
import extra.*;
public class Bokhylla {
  int x;
  public Bok[] bicker; //or whatever that is, doesn't show right here
  public Bokhylla (int antal) {
      x = antal;
      bicker = new Bok[x];
    //or just use bicker = new Bok[antal]; and forget about x
}None of the objects in the bicker array will be accessible until you instantiate them as well, so you will have to do:
for (int count = 0; count < antal; count++)
   bicker[count] = new Bok();

Similar Messages

  • I recently updated my computer to 10.6 and now I can't get my printer MX340 (canon ) to work. I have installed the new drivers both from Canon's website and from an earlier post directly from apples website. I would surely appreciate some help with this.

    I recently updated my computer to 10.6 and now I can't get my printer MX340 (canon ) to work. I have installed the new drivers both from Canon's website and from an earlier post directly from apples website. I would surely appreciate some help with this.

    Try what Terence Devlin posted in this topic:
    Terence Devlin
    Apr 14, 2015 11:21 AM
    Re: Is Iphoto gone ? i want it back!
    in response to Johannes666
    Recommended
    Go to the App Store and check out the Purchases List. If iPhoto is there then it will be v9.6.1
    If it is there, then drag your existing iPhoto app (not the library, just the app) to the trash
    Install the App from the App Store.
    Sometimes iPhoto is not visible on the Purchases List. it may be hidden. See this article for details on how to unhide it.
    http://support.apple.com/kb/HT4928
    One question often asked: Will I lose my Photos if I reinstall?
    iPhoto the application and the iPhoto Library are two different parts of the iPhoto programme. So, reinstalling the app should not affect the Library. BUT you should always have a back up before doing this kind of work. Always.

  • I'm moving to college soon, and would appreciate some help with my library.

    I am moving to college in just over a week and a half and was needing some help with my iTunes library. Currently, at home, I use iTunes as my main source of music entertainment. I purchase music through the iTues Store and upload older music from CDs onto the library as well. I have made several smart playlists based off of information such as play counts and last played dates. Unfortunately, this is all on a desktop that I will be unable to bring with me to school. So I have recently purchased a laptop that I will be taking with me to school. I have already downloaded iTunes and have activated the laptop to my Apple ID. The desktop currently runs on Windows 7, while the laptop runs on Windows 8. Both are up-to-date with iTunes.
    With all of that background information, here comes my question. Is there a way to have the same library on both PCs? I don't just mean the same songs, but rather have the same play counts, last played dates, playlists, etc. on both computers. Is this something that can be accomplished through the cloud or iTunes Match?

    Copy the ENTIRE /Music/iTunes folder from the old computer to the new computer.
    Sync only with the new computer going forward.
    Nothing will be updated on the old computer, but if you are not going to be at home using the desktop is that really relevant?

  • My camera Canon G3 (i know it's old) no longer connects to iPhoto (8.1.2) on my iMac, I have checked with my friends iMac same model iPhoto version and it works fine using my cable, I would appreciate any help getting this sorted

    My camera Canon G3 (i know it's old) no longer connects to iPhoto (8.1.2) on my iMac, I have checked with my friends iMac same model iPhoto version and it works fine using my cable, I would appreciate any help getting this sorted

    As a Test:
    Hold down the option (or alt) key and launch iPhoto. From the resulting menu select 'Create Library'
    Import a few pics into this new, blank library. Is the Problem repeated there?

  • Would appreciate some help here still fairly new to MAC

    Ok I've made the mistake of installing a program called Anacron which is supposed to help with the maintenance of OS X. Well I found out after the fact that there is no need to install ANY programs for maintenance as it is all built into the OS now. So I went to uninstall it and wow has this been a headache . First off there is NO uninstaller and when following the read me file that I found to uninstall it, part of it works and part of it doesn't. This is the information to just disable it (not delete it):
    How do I disable or remove anacron?
    To disable anacron, run the following commands in a terminal:
    cd /Library/LaunchDaemons
    sudo launchctl unload -w ./anacron.plist
    cd /System/Library/LaunchDaemons
    sudo launchctl load -w ./com.apple.periodic-daily.plist
    sudo launchctl load -w ./com.apple.periodic-weekly.plist
    sudo launchctl load -w ./com.apple.periodic-monthly.plist
    The above worked, but the info which is supposed to help you delete it all together does NOT work and I would appreciate some help/comments on why it doesn't. Here is the info for deleting it:
    To completely remove anacron from your system, delete (trash):
    /usr/local/sbin/anacron
    /usr/local/share/man/man5/anacrontab.5
    /usr/local/share/man/man8/anacron.8
    /Library/LaunchDaemons/anacron.plist
    /etc/anacrontab
    /var/spool/anacron
    /Library/Receipts/Anacron.pkg
    When I use Terminal to get in there and delete that stuff, when I try and delete Anacron, I'm given a list of file attributes (I guess) .. it looks something like this:
    override rwxr-xr-x root/wheel for anacron?
    What in the world does this mean and how in the world can I get this crap deleted from my system? Seems like everything I do is not enough to get this stuff deleted.
    Thank you for your time

    "Are you borrowing some frined's account, you have lots of messages here for a guy fairly new to mac"
    No, the mac is mine, and this is my account. I still consider myself pretty new to MAC OS X. The time of me registering here is right at the same time I received my iMac which is just over a year. To me that is still pretty new I may have a buttload of posts, but that doesn't mean I know a lot about MAC OS X and the MAC computers.
    I certainly appreciate your help with this problem. It worked flawlessly. This is very much like DOS in windows......yuk, just reflecting on the past. Thank you again, sooo much. I now feel much better, what a relief.
    Edit: Oh by the way, just answering "Yes" gave me, if I remember correctly, something about forbidden. But doing it the way you described above using the sudo lines worked great and it asked me for my user password, I put it in, then everything was ok, it deleted everything I wanted it to.
    Message was edited by: QuickDraw

  • How can I reset my Mac to default settings? Or how can I reset it to a prior date? My Mac has a virus and I would like to get rid of it. I would appreciate your help concerning this matter.

    How can I reset my Mac to default settings? Or how can I reset it to a prior date? My Mac has a virus and I would like to get rid of it. I would appreciate your help concerning this matter.

    To restore it follow these instructions: What to do before selling or giving away your Mac.
    Before you do the above check out the following;
    Helpful Links Regarding Malware Problems
    If you are having an immediate problem with ads popping up see The Safe Mac » Adware Removal Guide, AdwareMedic, or Remove unwanted adware that displays pop-up ads and graphics on your Mac - Apple Support.
    Open Safari, select Preferences from the Safari menu. Click on Extensions icon in the toolbar. Disable all Extensions. If this stops your problem, then re-enable them one by one until the problem returns. Now remove that extension as it is causing the problem.
    The following comes from user stevejobsfan0123. I have made minor changes to adapt to this presentation.
    Fix Some Browser Pop-ups That Take Over Safari.
    Common pop-ups include a message saying the government has seized your computer and you must pay to have it released (often called "Moneypak"), or a phony message saying that your computer has been infected, and you need to call a tech support number (sometimes claiming to be Apple) to get it resolved. First, understand that these pop-ups are not caused by a virus and your computer has not been affected. This "hijack" is limited to your web browser. Also understand that these messages are scams, so do not pay any money, call the listed number, or provide any personal information. This article will outline the solution to dismiss the pop-up.
    Quit Safari
    Usually, these pop-ups will not go away by either clicking "OK" or "Cancel." Furthermore, several menus in the menu bar may become disabled and show in gray, including the option to quit Safari. You will likely have to force quit Safari. To do this, press Command + option + esc, select Safari, and press Force Quit.
    Relaunch Safari
    If you relaunch Safari, the page will reopen. To prevent this from happening, hold down the 'Shift' key while opening Safari. This will prevent windows from the last time Safari was running from reopening.
    This will not work in all cases. The shift key must be held at the right time, and in some cases, even if done correctly, the window reappears. In these circumstances, after force quitting Safari, turn off Wi-Fi or disconnect Ethernet, depending on how you connect to the Internet. Then relaunch Safari normally. It will try to reload the malicious webpage, but without a connection, it won't be able to. Navigate away from that page by entering a different URL, i.e. www.apple.com, and trying to load it. Now you can reconnect to the Internet, and the page you entered will appear rather than the malicious one.

  • Error 1603: Need some help with this one

    When installing iTunes I first get an error box saying
    "Error 1406: Could not write value to key \Software\classes\.cdda\OpenWithList\iTunes.exe. Verify that you have sufficient access to that key, or contact your support personnel."
    The second one (after I click on Ignore on the last box) I get it this one:
    "Error: -1603 Fatal error during installation.
    Consult Windows Installer Help (Msi.chm) or MSDN for more information"
    Strange thing is that I do have full access to my computer (or atleast in all other cases I have had since I am the only one with an account on it).
    I have done my best in trying to solve it myself but I'm running out of ideas. I have downloaded latest versions from the website and tried installing Quicktime separately. I have also tried removing Quicktime using add/or remove programs though I just I didn't dare to take full removal because it said something about system files.
    Anyway I really need some help with this, anyone got any ideas?
    Greets,
    Sixten
      Windows XP Pro  

    Do you know how to count backwards? Do you know how to construct a loop? Do you know what an autodecrementor is? Do you know how to use String length? Do you know Java arrays start with index 0 and run to length-1? Do you know you use length on arrays too? Do you know what System.out.println does?
    Show us what you have, there isn't anything here that isn't easily done the same as it would be on paper.

  • Powerpoint presentation I have stored in icloud until recently were syncing to Keynote on my iPad with no problem.  Now when I open Keynote on my iPad there is nothing.  I could use some help with this problem.

    powerpoint presentation I have stored in icloud until recently were syncing to Keynote on my iPad with no problem.  Now when I open Keynote on my iPad there is nothing.  I could use some help with this problem.

    Morning AndreD86,
    Thanks for using Apple Support Communities.
    These articles explain exactly what is backed up by using their method.
    iTunes: About iOS backups
    http://support.apple.com/kb/ht4946
    and
    iCloud: Backup and restore overview
    http://support.apple.com/kb/ht4859
    Also we want to double-click the Home button and swipe the Task Bar to the right.
    Then make sure the button on the far left of Task Bar is not muted.
    Best of luck,
    Mario

  • HT204408 My applications folder has a black question mark on it at the bottom of my screen. I do not know what error I made, but my fan effect of the previous applications has gone away. Can I get some help with this?

    One day ago I inadvertantly removed my applications folder. In it's place is a folder with a black question mark which appeared after I attempted to open up the applications file. Also, previously when I clicked on the file applications would open in a fan display. Could I please get some assistance with this?

    ...removed my applications folder.
    From where? And to where?
    If you trashed it and emptied the trash, what backup, if any, do you have? If it's still in the Trash, move it back.
    If no backup, reinstall Snow, which will give you the version as of the DVD you use, then update back to 10.6.8, and run all other needed updates, including any security updates. This should save all your third party programs, as well as settings.
    The white puff of smoke is nothing, it only means you moved it out of the Dock. If you still have it, or had it, as soon as you open it it would reappear in the Dock. The item in the Dock is only a kind of alias.

  • I would appreciate some help.

    Hello, I had a problem recently where my imac crashed to a blue screen while running windows in bootcamp. It appeared to be a major problem and I could no longer boot to the windows partition.
    I was able to finally start my computer up on the mac partition thanks to some help from the forum there. However it appeared that the windows portion had met a fatal problem so I deleted the partition from the mac os partition. I continued to try and restall that partition but recieved an error.
    After more research it appeared the error would be fixed by using disk utility to repair the hard drive. I ran the disk repair and it froze midway through. I waited an hour and it was still frozen so I restared.
    After restarting there was the folder with the ? it appears my entire mac os partition was also eliminated. I now have the mac-os cd in and am attempting to re-install but am coming across a problem.
    When prompted with a select destination volume to install mac os it is empty. It appears my harddrive is gone.
    If i go under utilities: Disk utility there is an icon of a harddrive called "media" however i cannot verify or repair anything on it. It also displays a total capacity of 0bytes.
    Under system profiler Serial-ATA it reads there was an error while scanning.
    Does this all mean that my harddrive died? And if so can it be replaced by the apple store? The computer reads iMac 7,1 intel core duo.
    thank you very much in advance.

    It possible your iMac's HD has failed. Run Apple Hardware Test: http://support.apple.com/kb/ht1509 if it reports errors then yes you are due for a trip to your local Apple Store or AASP, either can repair it.
    Because you don't state where you are located I'm not sure this link will work. If you are in the US then it's fine. http://www.apple.com/buy/locator/service/
    Please update your profile with more information.
    Good luck,
    Roger

  • I have Adobe Reader Version 11.0.03 and can't open PDFs.  Would appreciate some help.

    I have Adobe Reader Version 11.0.03 on a new iMac OSX Version 10-8.4 and can't open PDFs.  Here's the message I get:  "There was an error opening this document. The file is damaged and could not be repaired."   Any help would be appreciated!

    What buttons do you get to click on with this message? What browser are you using (e.g. Safari, Chrome, Internet Explorer...)

  • Using the camera on my iPad 2, I can record videos, but can't get them to play back.  I'd appreciate your  help with this!

    Using the camera on my iPad 2, I can record videos, but can't get them to play back.  Can you help me with this?     Thank you!

    Previous version was a touch to change, this one is a slide to change.  

  • Could i get some help with this one

    the aim of this project is to make a n by n maze and traverse this. if, while traversing the maze the system realises that there is a dead end it turns back. My problem is that sometimes it turns back and sometimes it doesnt. Here, below is the method for traversing the maze. Could i get a second pair of eyes to help me out a bit with this code?
         * Prints out the current maze
        public void show()
             for (int i=0;i<array.length;i++)
                for (int j=0; j<array.length;j++)
    System.out.print(array[i][j]) ;
    System.out.println();
    * traverses through the maze
    * @param row: the current row
    * @param column: the current column
    public void traverse(int row, int column)
    if ((row==3)&&(column==column-1))//checks if the array has reached the end
    System.out.println("array is solved");
    }else
    if(array[row-1][column]=='.')//checks if should move up
    array[row][column]='x';//marks path
    array[row-1][column]='x';//marks path
    System.out.println();
    show();
    traverse(row-1,column);
    }else
    if (array[row+1][column]=='.')//checks if should move down
    array[row][column]='x';//marks path
    array[row+1][column]='x';//marks path
    System.out.println();
    show();
    traverse(row+1,column);
    }else
    if(array[row][column+1]=='.')//checks if should move left
    array[row][column]='x'; //marks path
    array[row][column+1]='x';//marks path
    System.out.println();
    show();
    traverse(row,column+1);
    }else
    if ((row!=3)&&(column!=0))
    if(array[row][column-1]=='.')//checks if should move right
    array[row][column]='x'; //marks path
    array[row][column-1]='x';//marks path
    System.out.println();
    show();
    traverse(row,column-1);
    }else/*1*/ if((array[row-1][column]=='#')||((array[row-1][column]=='*'))&&(array[row+1][column]=='#')||(array[row+1][column]=='*')&&(array[row][column+1]=='#')||(array[row][column+1]=='*'))
    //checks if up is clear to move back
    //checks if down is clear so could move back
    //checks if right is clear to move back
    if(row==3&&column-1==0)//checks if at the beginning of the array
    System.out.println("MAze cannot be solved");
    }else
    if (array[row][column-1]=='x')//checks if behind has a x to move
    array[row][column]='*';//prints dead end
    array[row][column-1]='.';
    System.out.println();
    show();
    traverse(row,column-1);
    }else/*2*/ if((array[row+1][column]=='#')||(array[row+1][column]=='*')&&(array[row][column-1]=='#')||(array[row][column-1]=='*')&&(array[row][column+1]=='#')||(array[row][column+1]=='*'))
    //checks if left is clear to move back
    //checks if right is clear to move back
    //checks if up is clear to move back
    if(row-1==3&&column==0)//checks if at the begining of the maze
    System.out.println("MAze cannot be solved");
    }else if (array[row-1][column]=='x')//checks if behind as been marked
    array[row][column]='*';//marks as dead end
    array[row-1][column]='.';
    System.out.println();
    show();
    traverse(row-1,column);
    }else/*3*/ if((array[row+1][column]=='#')||(array[row+1][column]=='*')&&(array[row][column-1]=='#')||(array[row][column-1]=='*')&&(array[row][column+1]=='#')||(array[row][column+1]=='*'))
    //checks if right is clear to move back
    // checks if left is clear to move back
    //checks if up is clear to move back
    if (array[row-1][column]=='x')//checks if behind as been marked as a path
    array[row][column]='*';//marks as dead end
    array[row-1][column]='.';
    System.out.println();
    show();
    traverse(row-1,column);
    } else/*4*/ if((array[row][column-1]=='#')||(array[row][column-1]=='*')&&(array[row+1][column]=='#')||(array[row+1][column]=='*')&&(array[row-1][column]=='#')||(array[row-1][column]=='*'))
    //checks if right is clear to move back
    //checks if down is clear to move back
    //checks if up is clear to move back
    if (array[row][column+1]=='x')//checks if behind has been marked as a path
    array[row][column]='*';//marks as dead end
    array[row][column+1]='.';
    System.out.println();
    show();
    traverse(row,column+1);

    morgalr wrote:
    That is truely one of the better threads that I've seen on the net for maze traversal.Forget "for maze traversal". That was one of the most interesting of all the threads I've seen here in quite a while. My sincerest admiration to those who contributed and eventually worked it out (and it wasn't me that's for sure), and especially to Keith. Impressive!

  • Who can I contact about getting some help with this ongoing (several months) issue???

    I will try to make a long story at least somewhat shorter.Comcast customer for 20 years (yes - literally 20 uninterrupted years). 8 years of service at current address.Several months ago I restructure my bill - all my promotions etc had run out and I wanted to reduce my bill.  Ended up being told my customer support that I could save money by getting the "Triple Play" (I've NEVER had comcast phone service, I have my own VOIP phone solution).  They told me I didn't have to "use" the phone, just getting it hooked up would save me money.  Fine.Internet service was not supposed to have been touched / changed at all. A few days after making these changes, a large box from Comcast shows up at the house.  It has TWO cable modems in the box.  Not sure why they sent them - I already had the latest cable modem (that was capable of supporting the phone service they needed to activate). Notified comcast about the shipment.  They said don't worry about it.  Okay, I left them in the box. Tech shows up at house while I'm working.  Wife called and I talked to tech. He said he just needed to get some "numbers" off the modem to activate the phone service (I'm in the IT industry - I will assume he wanted MAC / SN#'s).  I made sure he was making no changes to the modem itself - I've got my own home network setup.  The Comcast cable modem serves as a gateway and it's in bridged mode.  Always has been. I have my own router etc. So a week or so after that visit, the modem started losing connectivity.  It happens almost EVERY DAY and it's almost always in the later afternoon (5:30-7pm EST) and sometimes late at night.  When this happens, the ONLY way to get the connection back is to unplug modem power AND the coax cable input.  It will then restart the modem and it comes back.  Simply unplugging power and restarting will not do it. After multiple hours spent with support on the phone (we activated the newest modem they sent - same issue.  Activated the other modem they sent - same issue.  In fact they weren't able to put one of them in bridged mode at all). They said a tech needed to come out. Tech comes out - checks the feed to the house.  Said there is a lot of noise in the lines.  (Please note that there is one main comcast feed to my house - it splits outside (in the comcast locked box) into two feeds which enter the house. One feed splits and runs the upstairs TV's (Digital Adapters) and the downstairs STB / DVR.  The other feed goes DIRECTLY to my cable modem. I ran those feeds myself when I moved in this house.  Never had an issue before. Cable TV never has issue - only internet.   So the tech replaced some ends on the upstairs line (Cable TV - he said that signal noise could cause issues with the internet).  I then helped the tech run a BRAND NEW line from the split at the comcast box, directly to the modem.  He said the signal / noise looked much better. Next day - same ISSUE - modem dropped connection.  Pull power and coax cable, reseat, modem restarts, signal comes back. I called support again.  They gave me an incident #.  Said they would have a "Crew supervisor" contact me, since it's obvious the problem lies outside of my home. A tech called and left a voice mail on my phone (was working when it came in, couldn't answer).  They did not leave a call back number. Called support again.  They told me a tech would call me back and was advised to leave a call back number.  That was MONDAY of last week.  Haven't heard anything.  The contact # is my cell...no missed calls. Is there another number I can call or email address so I can escalate this issue?  Having to disconnect / reconnect the modem EVERY DAY at least once is getting tiresome.   I'm in the Richmond Virginia area if it matters at all. Thanks.

    ctandc-
    I am so sorry for the delay! I am sending you a private message so that we can discuss your billing concerns more freely.
    At the top of each Forum page, you will see a small gray envelope icon. This icon will have a number next to it if you have any new messages waiting. To open a PM to read it, double click on the envelope. If you click on the white envelope a window will open with tabs for your Private Message Inbox, Sent Messages, Friends, Ignored Users, and Compose new Message. You can also access this area by clicking on the Username in a Thread or post. By default, Private Messages are enabled. You can disable this feature in My Settings>Preferences> Private Messenger.

  • Need some help with this Design.  Not sure if it can be done.

    I am a full time RVer. I have a complex system installed in my RV. I am trying to share a wireless or use my AE to feed internet to the devices in my rack and allow my Apple TV to connect to my MBP over gigabit for streaming reasons.
    Is there a way to share my internet to the AE so that it will feed the 3 ports? Can I somehow connect to a hotspot and share that internet connection to the other devices on my network wired and wireless?? I am mainly concerned with getting internet to the ATV while connected to it via ethernet for the gigabit connection.
    It seems that I can connect the AE to a hotspot or WAP, but then I loose the ability to turn bridged mode off so that it will hand out DHCP ip addresses to the ethernet devices. I cannot extend any network unless the hotspot is using an apple device for its WAP. This is what apple told me when I was trying to extend my Linksys WAP4400N.
    Any ideas or advice here would be great. I am just stuck for a solution to what I want to accomplish.
    Thanks

    One possible solution....(if I understand correctly what you're trying to accomplish with what you have to work with) I'm assuming that the Linksys has no internet connection in the RV and isn't really needed in my idea below.....or do you have a satellite connection (or some other internet source besides a public wireless network?
    You could have your MBP join the wireless network, set up internet sharing (see OS X help) and share from airport to ethernet, connect an ethernet cable from MBP to WAN port on the Extreme, set the Extreme's connection sharing to "share a public IP", ignore the double NAT error (or you may be able to bridge it, I can't remember if the MBP will hand out several IPs but I think it will), and plug your Apple TV into a LAN port on the Extreme. Come to think about it, you really don't even need the Extreme unless you need other clients to connect, just plug the Apple TV into the MBP.
    hope it helps

Maybe you are looking for

  • How to ORDER BY Different column than in the group by clause.

    Hello, I have this sql statement SELECT COUNT([Tags]) AS CNT, [Tags] FROM [Tags], [Images] WHERE ([Images].[Tags] LIKE '%' + [Tags].[LongTag] + '%') AND ([Tags].AllowTagPost = 'True' ) GROUP BY [Images].[Tags] HAVING COUNT([Tags]) > 30 ORDER BY [Tags

  • Unable to play internet.

    Hi friends, I am new to solaris,and installed solaris 9 OS 7 days before on x86 machine , while installation i made a mistake on filling my IP address... i placed 192.166.-.- in place of 192.168.-.- , after installation i made the correction in corre

  • 0FIGL_V30 only usable for the new general ledger?

    Hello, I activated the business content for the cube 0FIGL_V30 / 0FIGL_M30, it looks very interisting, but I am not sure if this cube also run when we use in SAP R3 the old general ledger. Can some one answer me, is the business content cube 0FIGL_V3

  • Restoring in Lion, using Time Machine saved in Snow

    I just replaced my HD and am in the process of reinstalling numerous items. I now have Lion, but prior to replacing the HD, I had Snow. I simply imported my vcard into address book, but it combined all the groups. I must have them separated, and ther

  • Very large Spotlight-V100 file

    I just rebuilt my Spotlight indexes on numerous partitions. Most are now 50-200 MB. On my largest partition (470 GB with 335 GB used) the index is almost 1 GB. This seems excessive. Anyone else think this is huge (i.e. too big... bug)? Ron