Results 1 to 4 of 4
  1. #1
    rajivjoshi's Avatar
    rajivjoshi is offline Member
    Join Date
    May 2010
    Posts
    13
    Rep Power
    0

    Question Cannot find symbol error

    can anyone help me out from this error..
    i pasted wht kind of error getting for this code



    import java.io.DataInputStream;
    public class reading {
    public static void main(String args[])
    {
    DataInputStream in = new DataInputStream(System.in);
    int intNumber = 0;
    float floatNumber = 0.0f;

    try
    {
    System.out.println("Enter the integer : ");
    intNumber = Integer.parseInt(in.readLine());
    System.out.println("Enter the float number : ");
    floatNumber = Float.valueOf(in.readLine()).floatvalue();
    }

    catch (Exception e) { }
    System.out.println("intNumber = : " +intNumber);
    System.out.println("floatNumber = : " +floatNumber);

    }

    }

    ERROR
    --------------------Configuration: <Default>--------------------
    C:\reading.java:22: cannot find symbol
    symbol : method floatvalue()
    location: class java.lang.Float
    floatNumber = Float.valueOf(in.readLine()).floatvalue();
    ^
    Note: C:\reading.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    1 error

    Process completed.

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    6

    Default

    There is no method floatvalue() in class Float. Java is case sensitive.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,005
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by rajivjoshi View Post
    C:\reading.java:22: cannot find symbol
    symbol : method floatvalue()
    location: class java.lang.Float
    floatNumber = Float.valueOf(in.readLine()).floatvalue();
    ^
    Note: C:\reading.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Java is case sensitive; the name is 'floatValue()' (with a capital V), not 'floatvalue()' (lowercase V).

    Read the suggestion your compiler made; you have used a deprecated API.

    kind regards,

    Jos

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    8

    Default

    Quote Originally Posted by PhHein View Post
    There is no method floatvalue() in class Float. Java is case sensitive.
    @OP And, why don't you simply use the parse method?

Similar Threads

  1. error cannot find symbol
    By jcoon3 in forum New To Java
    Replies: 3
    Last Post: 09-27-2009, 10:56 PM
  2. Replies: 9
    Last Post: 10-18-2008, 08:26 PM
  3. 'Cannot find symbol' error
    By minihazard10 in forum New To Java
    Replies: 6
    Last Post: 10-10-2008, 04:05 AM
  4. Error: cannot find symbol
    By silvia in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 05:39 AM
  5. Error: cannot find symbol
    By cachi in forum AWT / Swing
    Replies: 1
    Last Post: 08-06-2007, 08:12 PM

Posting Permissions

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