Results 1 to 5 of 5
  1. #1
    tlouvierre is offline Member
    Join Date
    Apr 2009
    Location
    I live Stafford Texas right outside of Houston.
    Posts
    78
    Rep Power
    0

    Default identifier expected

    Java Code:
    import java.io.*;
    import java.util.*;
    
    class Dvd extends Object
    {
    private String dvdTitle;
    private double dvdStock;
    private double dvdPrice;
    private double dvdItem;
    
    public Dvd( String title, double stock, double price, double item )
    {
    //implicit call to Object constructor occurs here
    dvdTitle = title;
    dvdStock = stock;
    dvdPrice = price;
    dvdItem = item;
    } //end four-argument constructor
    
    //set DVD name
    public void setdvdTitle( St
    }
    {
    E:\IT 215 Java Programming\DVD extends Object.java:21: <identifier> expected
    public void setdvdTitle( St
                               ^
    E:\IT 215 Java Programming\DVD extends Object.java:23: reached end of file while parsing
    I understand what reached in of file means. It means to add a { at the end of the sentence. I have not learned what identifier expected means. Please explain to me in normal english not in Java. You see I am a little confused because I took C++ in another class and well I just don't understand.

  2. #2
    tlouvierre is offline Member
    Join Date
    Apr 2009
    Location
    I live Stafford Texas right outside of Houston.
    Posts
    78
    Rep Power
    0

    Default

    I will look identifier expected up in the reference manual. O.k?

  3. #3
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    8

    Default Missing something

    I think your problem is that you didn't place a closing pararentesis:
    Java Code:
    public void setdvdTitle( St [B][COLOR="Red"])[/COLOR][/B]
    }
    {
    Also, you will need to indicate what type St is... is it a String, an int, a double, etc?

    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

  4. #4
    tlouvierre is offline Member
    Join Date
    Apr 2009
    Location
    I live Stafford Texas right outside of Houston.
    Posts
    78
    Rep Power
    0

    Default E:\IT 215 Java Programming\class Dvd extends Object.java:23: class, interface, or enu

    Quote Originally Posted by CJSLMAN View Post
    I think your problem is that you didn't place a closing pararentesis:
    Java Code:
    public void setdvdTitle( St [B][COLOR="Red"])[/COLOR][/B]
    }
    {
    Also, you will need to indicate what type St is... is it a String, an int, a double, etc?

    Luck,
    CJSL
    Heelllo, How are you today? I expect pretty busy. As am I. I tried your theory on adding an } parenthesis and I got what is issued as this title for this transmission. Again, E:\IT 215 Java Programming\class Dvd extends Object.java:23: class, interface, or enum expected
    return setdvdTitle;
    I added "return setdvdTitle" I did not know what else to put to call the object. I mean I am calling the object setdvdTitle but I do not see it anywheres else in the program so how do I establish it? If in fact that is the problem.

  5. #5
    tlouvierre is offline Member
    Join Date
    Apr 2009
    Location
    I live Stafford Texas right outside of Houston.
    Posts
    78
    Rep Power
    0

Similar Threads

  1. <identifier> expected, I'm stuck
    By UnderpaidWorker in forum New To Java
    Replies: 18
    Last Post: 12-13-2008, 05:14 AM
  2. Replies: 3
    Last Post: 12-05-2008, 08:34 PM
  3. getting identifier expected error . help me !
    By victorkeath in forum New To Java
    Replies: 3
    Last Post: 11-07-2008, 05:49 PM
  4. Identifier expected error
    By vasu18 in forum New To Java
    Replies: 1
    Last Post: 01-01-2008, 05:49 PM
  5. Error: <identifier> expected
    By barney in forum AWT / Swing
    Replies: 2
    Last Post: 07-31-2007, 07:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •