Java IO Error, not sure why.

Okay, these three classes are.. well.. basically non-existant, so I feel no reservations at posting them here. Please, someone, have a look and tell me why I'm getting an error in the child class. I'll post more further down.
CLASS ONE
import cs1.Keyboard;
public class CharCreate
     public CharCreate(String cN, String pN, String cP, String cT)
          if (cT.equalsIgnoreCase("foot soldier")==true)
               FSoldier dude = new FSoldier(cN,pN,cP);
          else if (cT.equalsIgnoreCase("heavy gunner")==true)
               HGunner dude = new HGunner(cN,pN,cP);
          else if (cT.equalsIgnoreCase("cavalry")==true)
               Cavalry dude = new Cavalry(cN,pN,cP);
          else if (cT.equalsIgnoreCase("medic")==true)
               Medic dude = new Medic(cN,pN,cP);
          else if (cT.equalsIgnoreCase("officer")==true)
               Officer dude = new Officer(cN,pN,cP);
          else if (cT.equalsIgnoreCase("engineer")==true)
               Engy dude = new Engy(cN,pN,cP);
          else if (cT.equalsIgnoreCase("special operations")==true)
               SOperations dude = new SOperations(cN,pN,cP);
     public static void newCharMaker()
          System.out.print("You have chosen to make a new character. Is that correct? (y/n) ");
          String keepGoing = Keyboard.readString();
          if (keepGoing.equalsIgnoreCase("y")==true)
               System.out.println();
               System.out.println("Welcome to the character creation process.");
               System.out.print("Character name? ");
               String cName = Keyboard.readString();
               System.out.print("Your name? ");
               String pName = Keyboard.readString();
               System.out.println();
               System.out.print("Password? ");
               String cPassword = Keyboard.readString();
               System.out.print("Re-enter password? ");
               String tempPassword = Keyboard.readString();
               System.out.println();
               while (cPassword.equals(tempPassword)!=true)
                    System.out.print("Passwords do not match, please enter the password again? ");
                    cPassword=Keyboard.readString();
                    System.out.print("Re-enter password? ");
                    tempPassword=Keyboard.readString();
                    System.out.println();
               String cType = CharCreate.createType();
               CharCreate alpha = new CharCreate(cName, pName, cPassword, cType);
          else
          System.out.println("Returning to Main Menu");
     public static String createType()
          System.out.println("Choose from the following archaetypes:");
          System.out.println("Foot Soldier\tHeavy Gunner\tCavalry\nMedic\t\tOfficer\t\tEngineer\nSpecial Operations");
          System.out.println();
          String omega = Keyboard.readString();
          System.out.println();
          while (omega.equalsIgnoreCase("foot soldier")!=true &&
               omega.equalsIgnoreCase("heavy gunner")!=true &&
               omega.equalsIgnoreCase("cavalry")!=true &&
               omega.equalsIgnoreCase("medic")!=true &&
               omega.equalsIgnoreCase("officer")!=true &&
               omega.equalsIgnoreCase("engineer")!=true &&
               omega.equalsIgnoreCase("special operations")!=true)
               System.out.println("Invalid choice, please try again?");
               System.out.println("Foot Soldier\tHeavy Gunner\tCavalry\nMedic\t\tOfficer\t\tSpecial Operations");
               System.out.println();
               omega = Keyboard.readString();
          return omega;
CLASS TWO
public class Cavalry extends Soldier
     public Cavalry(String n, String p, String p2)
          super(n,p,p2);
CLASS THREE
import java.io.*;
public class Soldier
     public Soldier(String n, String p, String p2) throws IOException
          String charName = n;
          String playerName = p;
          String password = p2;
          PrintWriter fileOut = new PrintWriter(new FileWriter(charName+".txt"));
          fileOut.println(charName);
          fileOut.println(playerName);
          fileOut.println(password);
          fileOut.close();
The error that JCreator is showing me is listed as follows:
C:\Documents and Settings\bellw\Desktop\Personal\Game\Cavalry.java:5: unreported exception java.io.IOException; must be caught or declared to be thrown
          super(n,p,p2);
^
Thank you for any assistance you may be able to provide.
If you have any suggestions, questions, solutions, please post here and/or e-mail me at [email protected]
Thank you,
Wayman Charles Bell III

Thanks, for now, I have imported java.io.* in all of my child classes.. and.. apparently in all my classes, period, and thrown IO exceptions in all of their methods. This seems to have remedied the problem, but I still do not understand why a class that does not do anything with files outside the .class should need these things.
Most of them are child classes of the Soldier class, which uses IO, but it's the only class. Every class I have that had some link, even indirectly, to it had to have java.io.* imported and have throws IOException put into every method. Why?
Also, thank you to everyone that replied.

Similar Messages

  • Hello, What does Kurler Klash mean? Not sure why an error in posting. has occured.

    Hello, What does Kruler Klash mean? Not sure why an error in posting occured.

    I ended up figuring out a solution, but I'll get to that in a sec.
    To answer your question, I converted the .wmv file in a program called Media Converter (available in the App store), and converted it to an h.264 file (then later to a .mov file, and then to an .mpg). I could view the file, and work with it in projects, but any project I tried to output with any version of said file, would result in the afor mentioned message, with the same results in FCPX (and Compressor 4 as well).  I tried multiple frame rates, resolutions, files types, re-converting the file, all with no luck.  My impression from said experiments, and reading other discussions was that it was a corrupt file. 
    Then I got frisky...and a little desperate. I brought the converted file (the .wmv to .mov) into Motion 4... and an export worked first try.  So I exported a pro-res file from Motion 4, and used that file in the already built Motion 5 project, and voila! 
    So, who knows what that means in real terms, as for the whats and whys.

  • Servlets can't access Oracle9i database - not sure why?

    Hi there,
    I got an error when it throws a SQLException in my Internet Explorer.
    Error:
    ======
    SQLException: Io exception: The Network Adapter could not establish the connection
    Is it bcs i uses scott/tiger?
    I places classes12.zip into c:\oraclejdbc
    and place this in my classpath:
    .;c:\oraclejdbc\classes12.zip;
    *Note: I places classes12.jar (also can't work)
    Then for a backup reason
    I go to C:\Tomcat5\common\classes
    and extract the classes12.zip in there
    i can see javax and oracle folders
    Then.. i make sure in my java codes (no compile error)
    java:oracle:thin@wenching:1521:wenching
    i was pointing to the right pc name and oracle server ID.
    Then i call my servlets into my j2me phone...
    it display all the necessary information.. on the data that should be extracted from the oracle 9i database.. display java.sql.SQLException...
    There are something wrong?
    Can you tell me what i left out? My servlets are working fine?
    But i had 2 java files...
    WebPage.java calls OracleConn.java
    and in web.xml
    i only point to WebPage.class and nothing to do with OracleConn (it is just connection classes).
    Any help, please?
    I also use lots of ways like placing classes12.zip or classes12.jar into many types of folders? Just not sure why cannot?
    I did not use the build in Tomcat for Oracle, but the latest Tomcat 5 series. The servelts works fine but not oracle. Could it be this problem? Like allowing which oracle database to call which web server?
    Thanks.

    It works?
    After i try this and that.
    I just notice 1 thing...
    The database is not connected physically.. even i can sql plus.. it!
    So i go to Oracle Database Admnistrator for Windows NT..
    and connect my servername WenChing..
    and now it works.. servlets can connect to oracle...
    Hooray!
    I hope it stills work when i reboot my machine.. coz i had no idea what i did... :)
    Sounds funny isn't it?
    Regards.
    Chua Wen Ching :p

  • Since iOS 7.1 my phone won't turn on and is asking me to connect to iTunes. I connect to itunes and it says it needs to be restored. Not sure why. I try to restore it and then it says something went wrong and it won't work. So I've been without my phone

    Since iOS 7.1 my phone won't turn on and is asking me to connect to iTunes. I connect to itunes and it says it needs to be restored. Not sure why. I try to restore it and then it says something went wrong and it won't work. So I've been without my phone for a couple days now. It gives me error code (29). The phone almost reboots and then 3/4 of the way through it gives me the error message.

    If using windows...
    Temporarily disable your firewall and antivirus software and try again...
    http://support.apple.com/kb/TS1379
    See iTunes Connection Issues here...
    iTunes for Windows: Troubleshooting security software issues
    NOTE:
    Make sure you have the Latest Version of iTunes (v11.1.5) Installed on your computer
    iTunes free download from www.itunes.com/download

  • Not sure why line break is not working

    Hi all,
    Here is part of my simple Swing application:
    String text1 = "hello";
    String text2 = "world";
    String text3 = text1+"\n"+text2;
    // have also tried (String text3 = text1+"\n\r"+text2;)
    displayField.setText(text3);I supposed that the text3 in the label field (displayField) would display like this:
    hello
    world
    But not, the text3 just displayed in the same line like this instead: helloworld.
    I am not sure why the line break is not working.

    Use HTML for a multiline JLabel.// String text3 = text1+"\n"+text2;
    String text3 = "<html>" + text1 + "<br/>" + text2 + "</html>";db

  • Not sure why Message is not working on my ipad.

    Not sure why message is not work on my iPad. It works find on my iPhone.

    http://support.apple.com/kb/TS2755

  • I received a text today while at work about iCloud keychain verification code. I have not signed up for it or anything that uses it. I work out of the city with limited internet access so not sure why I would be getting this. Is my info safe??

    I received a text today while at work about iCloud keychain verification code. I have not signed up for it or anything that uses it. I work out of the city with limited internet access so not sure why I would be getting this. I only got this number about a month ago. Apparently someone else had the number before because I get texts from his family members wondering whats going on. I got one yesterday and the person didn't seem to thrilled that the number was cutoff and today I got 2 texts about iCloud Keychain which I don't even know what it is. Seems suspicious to me. If the person who use to own the number is doing it he should know it is not his number anymore because he obviously didn't pay his bills.  I'm not too sure about iCloud Keychain so just want to know my info safe?? It says it can store credit card numbers which is what gets me worried. Frankly I think it's pretty stupid to save that kind if information with any kind of app. But I don't want some random person trying to access my personal information because they are bitter they lost their number.  Please let me know as soon as possible so I can change passwords or anything that is needed.
    thanks

    If it were me, I would go to my carrier and get a new number. Since you have only had it for a month, the inconvenience would be minimal.
    Barry

  • Not sure why but when i open a new tab my top sites are no longer showing not even a toggle switch it's just one big blank white page? how can i correct this ?

    i did have my most visited sites in the pin ups yet for some reason or other not sure why but not when i open a new tab all there is, is one big blank white page. Not a toggle switch not even blank pin up thumb nails. Any help would be greatly appreciated. thank you

    See this old question:
    *[https://support.mozilla.org/en-US/questions/982051#answer-517878 /questions/982051#answer-517878]

  • Windows vista not recognizing my iphone4s when i open itunes, keep getting trust / dont trust message on phone and always press trust. Not sure why it's started doing it. Can not synch iphone at all or add new music....aaahhh

    windows vista not recognizing my iphone4s when i open itunes, keep getting trust / dont trust message on phone and always press trust. Not sure why it's started doing it. Can not synch iphone at all or add new music....as itunes does not pick up the phone I have connected anymore. My ipod synchs fine still and thats over 6 years old!

    Hi rubicon7,
    Welcome to the Support Communities!
    The article below may be able to help you with this.
    Click on the link to see more details and screenshots. 
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    If the issue is not resolved, you may need to uninstall iTunes and all of it's components, and reinstall the latest version as explained in this article:
    Issues installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/HT1926
    I hope this information helps ....
    Have a great day!
    - Judy

  • I can no longer print any document in PDF format. Not sure why

    I can no longer print any document in PDF format. Not sure why? When I try to print, the document saves to my hard drive as a PDF and will not allow me to print? Never had this issue before. Any thoughts?

    Print to file is in the main print dialog (on Acrobat 9.x) as opposed to under Advanced

  • HT204150 im not sure why only a few of my contacts have been synced and not everyone? How do i sync all contacts from my iphone to my ipad? I have synced my phone with Itunes on my laptop.

    im not sure why only a few of my contacts have been synced and not everyone? How do i sync all contacts from my iphone to my ipad? I have synced my phone with Itunes on my laptop.

    It's a good idea to backup your Mac Address Book application and iCal Calendars application from each application. This way you can go back and pull out items if you lose something. I do this everyday.

  • From some reason (i'm not sure why..) my whole iphoto library got deleted. I restored the whole library from my backup. The photos are blank but steel have the photo info. (date, res., size etc.) Do you know what's the prob.? why can't i see my pics.

    from some reason (i'm not sure why..) my whole iphoto library got deleted. I restored the whole library from my backup. Now all the photos are blank but steel have the photo info. (date, res., size etc.) Do you know what's the prob.? why can't i see my pics.

    It's says that file does not exist. How come? And why does it still show the image info.?
    Where can i find those files (i have a daily backup)
    The original image files are missing form your iPhoto library or iPhoto cannot find them, because the link to the originals has been broken. The image info is stored in the internal libraries, independent of the original files. That is, why you are still seeing them.
    I restored the whole library from my backup.
    Try restoring from an older backup, from before you first noticed the problem. 
    How large is the library, that you restored? Is the file size large enough to hold all your photos, or has the size been reduced?  If the library is still large, the photos may still be inside, even if iPhoto cannot find them.
    It's says that file does not exist. How come?
    What happened, before your iPhoto library got deleted? Which applications have you been running, or which new software have installed or upgraded?  Have you moved the library to a different disk or tried to use it from different user account or access it over the network?

  • Photos from the Internet will not load correctly. I get white boxes with blue question marks inside. This has only been happening for the past 3 weeks so I'm not sure why it is happening.

    Photos from the Internet will not load correctly. I get white boxes with blue question marks inside. This has only been happening for the past 3 weeks so I'm not sure why it is happening.

    Yes - email &amp; text work fine but when I use something like Google Images or search a blog with imbedded photos I get the empty white boxes with question marks.  If I click the question mark it opens the photo but I can't possibly do that for EVERY image on EVERY page I search!?!?!  I've rebooted the iPad &amp; my wireless card several times but neither action helped.  Have any clue what I should do now?

  • Podcast only displaying 2 episodes not sure why older episodes do not appear in itunes store?

    Good evening!
    Hope all is well. My podcast currently has 40 episodes, but only the most recent 2 episodes are being displayed in the itunes store. Not sure why all of them are not displayed for download? Can you please investigate?
    http://itunes.apple.com/us/podcast/parenthood-podcast/id489620970
    Feedburner: http://parenthoodpodcast.com/feed
    Thanks in advance for your time!
    Best ~ Ted

    Good evening!
    Hope all is well. My podcast currently has 40 episodes, but only the most recent 2 episodes are being displayed in the itunes store. Not sure why all of them are not displayed for download? Can you please investigate?
    http://itunes.apple.com/us/podcast/parenthood-podcast/id489620970
    Feedburner: http://parenthoodpodcast.com/feed
    Thanks in advance for your time!
    Best ~ Ted

  • My iphone5 crashed Wed May 29 and I am not sure why.. I had to do a restore and have been trying to slowly get everything back on the phone... Yesterday June 6 it blacked out once and I don't have everything on the phone as before.... New one?

    My iphone5 crashed Wed May 29 and I am not sure why.. I had to do a restore and have been trying to slowly get everything back on the phone... Yesterday June 6 it blacked out once and I don't have everything on the phone as before.... Is it damaged and should I try to get a new one?

    Thank you again for all of your help!! I really appreciate it!
    I think I am following -- I was able to upload to my iPhoto and all photos and videos are there that is a plus! I tried to create an Event in my iPhoto and put all of my photos in that event but for some reason, now my iTunes it not recognizing that Event in my iPhoto. It is not allowing me to import just that event at the moment but I may be doing something wrong. At least all of my pics and vids are in iPhoto so that is a plus and I know they are at least saved somewhere. Just for some reason, my iTunes it not locating the event that I created with only those photos.
    Thank you for letting me know about my contacts! How do I know if I have the contacts app?
    Also, I had no clue that my iCloud could be backed up via cellular data! However, is this a new feature with the most updated iOS?? Unforutnatly I am like 2 iOS updates behind because I don't have enough storage on my phone. I still get the notification that my phone needs to be plugged in and connected to wifi in order to back up to the cloud :-(
    How can I sync using USB? Right now when i click on the info tab for my iPhone in my iTunes this is the answer that I get -- I am a little unclear as to what it means.
    Sync Contacts:
    Your contacts are being synced with you iPhone over the air from iCloud. Over-the-air sync settings can be changed on you iPhone
    Sync Calendars:
    Your calendars are being synced with you iPhone over the air from iCloud. Over-the-air sync settings can be changed on you iPhone

Maybe you are looking for

  • Cache lookup failed

    Dear Experts, I am stuck on the error :*' ERROR [HY000] ERROR: fmgr_info: function 0: cache lookup failed'* while calling a stored procedure(SP). The function in the SP run successfully but while calling the same SP from call function then it is exec

  • Resizing images within Mail not working in Snow Leopard

    Hi, I recently upgraded to Snow Leopard on both my desktop (iMAC Quad Core) and my MacBook Pro. I'm now experiencing an issue when I attach images within the Mail application. In the past, if I attached an image I could resize it by selecting the opt

  • How to turn OFF Reports Background Engine?

    I know how to programatically invoke the RBE [win_api_shell.winexec('c:\orant6.0\bin\rwrbe60',WIN_API.SW_SHOWMINIMIZED);] But the RBE stays out there after the report runs. Does anyone know a way to TERMINATE it programmatically? Same question for th

  • ITunes 10.4.1 for OS 10.5.8: download or not?

    Apple insist I write something here, but my question is in the subject line!

  • Broadcast config + Web analyzer

    Hi, i need to use broadcast but when i make navigation in a report or something when i click on broaadcst module it does not make any reference to my query and/or navigations. is it normal ? second question is there a document to set up the broadcast