Modified constructor compiles as unsafe or unchecked any ideas?

Dear sun forums members/viewers,
Please find below code that compiles but gives me errors with bluej ide.
I am very newbie to java - please have mercy on me!
Thanks in advance tma03 due in tomorrow (sobs) Barrie
* Constructor that takes two arguments theText and theUrl
* changes the instance variable text to the argument supplied
* with new constructor theText, theUrl is then assigned to the
* instance variable url
public WebPageData(String text, String theUrl)
super(); // cant get use super(text, theUrl) as it wont compile
this.wordSet = getWordsIn(text);
this.url = theUrl;
// uses unsafe or unchecked operations (?)(?)
}

Dear hiwa,
Thanks for your prompt response and link to the 2 howtos - I posted this snippet directly from my tutor marked assignment - then realised I probably should not have posted it all!
I thought it might be a simple syntax error that would be obvious to experienced Java users.
From my notes I thought I should include super(text, theUrl) but that gives me the error:
Object() in java.lang. Object cannot be applied to (java.lang. String,java.lang. String)
To post the whole class would involve over half the assignment so far, not something I think the OU would appreciate.
Best regards Barrie

Similar Messages

  • Constructor compiles, arraylists, not calling method correctly?

    I am starting back on the program from yesterday! Working with arraylists
    I have the constructor compiling, both class files compile.,
    with the code i have in the driver file, the driver file is not compiling
    code is:
    for hotel class: (compiles)
    import java.util.ArrayList;
    public class Hotel//Sets the class
          ArrayList<Room> theRooms;
          private String name;
          private String location;
          private int occupiedCnt=0;
          private double occupancyPercentage = 0;
          private double DailySales = 0;
          private static final int NOT_FOUND = -1;
    contructor method
    public Hotel(String n, String a)
            name = n;
            location = a;
    /** accessor methods with calculations
    //returns a boolean that is true if all the rooms in the hotel are occupied
    public boolean isFull()
       return true;
    //returns a boolean that is true if all the rooms in the hotel are unoccupied.
    public boolean isEmpty()
       return true;
    The Hotel will have an addRoom method that will create each room with the required
    information: room number, bed type, smoking/non-smoking, and the room rate.  Create
    at least 5 rooms with different characteristics. Each room will also have a boolean
    field called occupied attribute that will be set to false when the room is created.**/
    public void addRoom(String bd, int rn, char s, double r)
       Room newRoom = new Room(bd,rn,s,r );
       theRooms.add(newRoom);
    }for the rooms class: (compiles)
    public Room(String bd, int rn, char s,
                      double r)
            roomNum = rn;
          bedType = bd;
          smoking = s;
          rate = r;     
       }For the driver file (does not compile and i am sure that I am calling the method incorrectly) first time working with arraylists.......
    public class TestHotel
    public static void main(String[] args)
             Hotel pensacola = new Hotel("Browns Town", "3308 Damon Dr Milton Fl32583");
             //pensacola.addReservation();
             pensacola.theRooms.add(newRoom("king",201,'s',59.99));        
    }        error that i am getting:
    ----jGRASP exec: javac -g C:\Users\Jessie\Documents\java\class project files\project 7\TestHotel.java
    TestHotel.java:25: cannot find symbol
    symbol : method newRoom(java.lang.String,int,char,double)
    location: class TestHotel
    pensacola.theRooms.add(newRoom("king",201,'s',59.99));
    ^
    1 error
    ----jGRASP wedge2: exit code for prcess is 1.
    ----jGRASP: operation complete.
    again i am sure it is something simple like how i am calling the method. any pointers appreciated.

    NEVER MIND...........maybe should be drinking coffee instead of drinking Coke!

  • I cant download Itunes on my new laptop, it says itunessetup.exe reported as unsafe....any ideas?

    Hi, I cant download Itunes onto a brand new laptop.....when i download it it says itunesSetup.exe is reported as unsafe......my only options are to cancel of view more details which doesnt help...
    ANY IDEAS?

    jacobfromworcester wrote:
    Hi, I cant download Itunes onto a brand new laptop.....when i download it it says itunesSetup.exe is reported as unsafe......my only options are to cancel of view more details which doesnt help...
    ANY IDEAS?
    Are you downloading from the Apple site, or some outside source? If from Apple, then I would suggest a false alarm from Windoze.
    Stedman

  • I am trying to stream via ESPNWatch but I get a message saying I have a popup blocker that does not allow the streaming to happen. I unchecked the pop up blocker box in the Safari preferences to no avail. Any ideas?

    I am trying to stream via ESPNWatch but I get a message saying I have a popup blocker that does not allow the streaming to happen. I unchecked the pop up blocker box in the Safari preferences to no avail. Any ideas?

    Might be a Safari extension...
    From your Safari menu bar click Safari > Preferences then select the Extensions tab.
    If there are any extensions installed, turn that OFF, then quit and relaunch Safari to test.

  • I am trying to organize thousands of images in aperture.  The dates on the old scanned images is all 2008, when I started importing them.  When I change the date in aperture some of them hold the modified date and some revert to 2008.  Any ideas?

    I am trying to organize thousands of old images in aperture.  Aperture dates them all in 2008, when I started this project.  When I change the date in aperture some of them hold the modified date and some revert to 2008.  Any ideas?

      I just tried a test library, re-imported fresh images from a hard drive, and the date changes still revert.
    So neither your external drive nor your Aperture library are to blame.
    What do you mean test in a different user acct?  Would it be a good idea to uninstall and re-download aperture 3?
    Appreciate all your help.
    I meant the trouble shooting procedure described here:  Isolating an issue by using another user account
    To test, if some settings in your user account are faulty or preferences files corrupted, it helps to create a new user account from the "Users&Groups" System preferences. With a brand new user account you can see, if something in your current account is causing this.
    Should you see, that Aperture is not even working from a new and clean account, I'd reinstall Aperture, and if need be the Operating system.  Are you using any plug-ins?

  • Copying files to my MBA Early 2011, 10.6.7 changes their 'date modified' to the current date. It happens only to some of the files copied. Any idea what my be causing it. Never had this problem before, on othe macs I have owned.

    Copying files to my new MBA (early 2011) running 10.6.7 results in their 'modification date' to change to the current date. Any idea what may be causing it. It happens only to some of the files (there is no pattern to it.). I have not seen it previously in many other macs I have owned.

    Hi all
    I am bumping this thread again because I can't believe that I am the only one experiencing this issue. At times it is costing me hours repeatedly copying files until eventually the date doesn't show as modified.
    I thought I had cracked it earlier by changing the Sharing & Permissions settings, and applying to enclosed items the ability for Everyone, Me and Staff fo have Read & Write permissions - but that doesn't seemed to have changed much.
    Copying in smaller batches helps sometimes, but then other times it makes no odds, and the Date Modified date shows as the original date for a few seconds, only to change to today's date. Driving me nuts because there is no pattern to it.
    Files which I have copied and show their original modified date, when moved to a subfolder, then have their date changed to today!!! Copying other files into the folder results in files that were previously OK having their Date Modified changed!
    Am I on the only one?

  • IPhoto won't open due to the not being updated but when I check to upgrade to iPhoto 11 it tells me it is installed. The photos in the library were modified using 9.1.5 and the iPhoto is said to be 7.1.5 (iPhoto 8). Any ideas?

    iPhoto won't open due to the not being updated but when I check to upgrade to iPhoto 11 it tells me it is installed. The photos in the library were modified using 9.1.5 and the iPhoto is said to be 7.1.5 (iPhoto 8). Any ideas?

    How do you know the library was modified with iPhoto 9 (11)?  If you've never had iPhoto 9 on your Mac it could'nt have.  It sounds like a damaged library. Make a temporary, backup copy (if you don't already have a backup copy) of the library and apply the two fixes below in order as needed:
    Fix #1
    Launch iPhoto with the Command+Option keys held down and rebuild the library.
    Select the options identified in the screenshot. 
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    Download iPhoto Library Manager and launch.
    Click on the Add Library button, navigate to your Home/Pictures folder and select your iPhoto Library folder.
    Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File ➙ Rebuild Library menu option
    In the next  window name the new library and select the location you want it to be placed.
    Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments but not books, calendars or slideshows. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    OT

  • I am trying to change the date on an imported home video clip. I entered 9/7/2012 and got 6/9/0339! I checked modify original file, but it is not working. Any ideas?

    I am trying to change the date on an imported home video clip. I entered 9/7/2012 and got 6/9/0339! I checked modify original file, but it is not working. Any ideas?

    Are you using the Adjust Date and Time option or the Batch Change option?  If it's the former try the latter.  If you get the same results  launch iPhoto with the Option key held down and create a new, test library.  Import  the same video file and check to see if the same problem persists.
    OT

  • Idoc error - Modify or delete Source List - any ideas experts PLZ?

    Hi experts,
    I create a source list record by using Idoc with segments E1EORDH and E1EORDM
    the source list record is correctly created in database
    <u>=> the problem is when I try to modify or delete this source list record</u>
    <b>Error message (always the same) : Please reconcile source list</b>
    I try to use different codes is msgfn but it dont work
    I think this message appear may be cause the source list record already exist..... and I want to modify or delete it, but it dont work
    Please, help me experts
    Thank you in advance

    Hi there,
    I am also currently encountering this same message and not sure what is wrong.
    Does anyone have any idea or resolution?
    Thank you.
    Cheers,

  • I cannot  upload a picture to modify a project, it shows all black on the timeline any idea?

    I am rying to modify an existing project by adding new pictures, i can drag them fine into the project, but in reality they appear as a black space later, looks like the project rejects them. Any idea?

    By "sending" do you mean sending email?
    If so, what app are you using to take the photos on your iPhone 5? Or are the photos from a different source (saved to your Camera Roll from somewhere else, like a web page or Messages)?
    My guess is that Mail gives you the option to send different file sizes when it detects you are trying to Mail a really large photo file. The size of photos on the iPhone 5 is really big and some email providers may stop your mail from being delivered if attachments are too large. Thus, Mail tries to help you by offering to resize the photo.
    I suspect that if you are sending smaller files, Mail does not bother giving you options to save a smaller version. In fact, I have seen this behavior. So, if the photo is already "small enough", it gets sent as-is.
    To my  knowledge, there is no global iOS setting for this. Some apps may have different rules, of course.

  • The output sound was somehow muted and grayed, so that I can't uncheck. Any idea how this happened or how i can undo it?

    The output sound was somehow muted and grayed so that I can't uncheck it. Any idea how this happened and how it can be undone?

    Hi, and welcome to Apple Support Communities.
    Which exact iBook model is it?
    You can choose from this list:
    http://www.everymac.com/systems/apple/ibook/index-ibook.html
    You could try resetting the PRAM and see if that helps.

  • I'm trying to burn a playlist to a CD but some of the songs won't burn.  They appear grey shaded with the checkbox unchecked.  I can play these songs.  Any idea why they wont burn?

    I'm trying to burn a playlist to a CD but some of the songs won't burn.  They appear grey shaded with the checkbox unchecked.  I can play these songs.  Any idea why they wont burn?

    Hello VwecheRiste,
    Thanks for using Apple Support Communities.
    To troubleshoot this issue where some songs do not burn to a CD, please follow the directions in the article below.
    Can't burn a CD in iTunes for Windows - Apple Support
    Take care,
    Alex H.

  • Cannot check or uncheck any of the music playlists on the new ipod from a backup.

    I bought a new ipod, and used the backup from an old ipod to replace all data and settings.  Everything else seems ok, but on the new ipod I cannot check or uncheck any of the music playlists.  How do I change this?

    This is how it should work.
    The iphone is not a storage/backup device.  It simply mirrors the selected content of the one computer to which it is synced.  If you sync to another computer, it will erase the current content and replace with the content from the new one.
    It has always been very basic to always maintain a backup copy of your computer for just such an occasion.  Use your backup copy of your old computer to put everything on the new one.

  • In Safari on my Macbook Air using Yosemite, I have the pop up box unchecked but I am still getting blocked on a few sites. Some sites will allow pop ups, any Ideas?

    While in Safari on my Macbook Air using Yosemite, I have the block pop ups box unchecked but I am still getting blocked on a few sites. Some sites will allow pop ups, any ideas?

    Yes, I do that every 30 minutes, thats not the issue tho, because it shows like for example, 4 months ago i search a celebrity on wikipedia ONCE, and it shows up if you type that first name in the search bar......
    Is there ANYWAY to get rid of this bug..or does Apple Mac come with a defect....is this happening for other people, can someone please check, I asked my friend it comes for her too, but way less results, and sometimes when she resets safari hers goes away for the moment, and comes back later when u search...hmmm strange...
    need help!!!

  • Using RHelp 9 - Compiled Help system missing book images on left pane? Any ideas on how to correct?

    Using RHelp 9 - Compiled Help system missing book images on left pane? Any ideas on how to correct?

    Hi there
    Colum seems to be making an assumption that you are producing Microsoft HTML Help, as the option he mentions only applies to the world of compiled CHM files.
    But this question was posted in the WebHelp forum category, so one might assume that you are producing WebHelp output.
    So the question we ask here is this:
    What *IS* the output type you are creating? WebHelp? Microsoft HTML Help? FlashHelp?
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

Maybe you are looking for