Results 1 to 2 of 2
  1. #1
    doobybug is offline Member
    Join Date
    Mar 2008
    Posts
    17
    Rep Power
    0

    Default Parsing vs Casting

    Can anyone tell me what is the difference between parsing and casting please?

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

    Default

    Quote Originally Posted by doobybug View Post
    Can anyone tell me what is the difference between parsing and casting please?
    Parsing and casting are two entirely different beasts. Parsing is (normally) the process of analyzing a String and checking whether or not it obeys certain grammar rules, e.g. your Java source code is parsed for syntax errors.

    Casting primitive types (ints, longs, doubles) is converting one type to another type according to certain rules. Parsing object types is 'viewing' an object as another type, e.g. a String also is an Object and it also implements the interface Comparable<String>. You can view/cast a String to all the other types.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Casting
    By zzpprk in forum Advanced Java
    Replies: 13
    Last Post: 08-13-2009, 07:59 PM
  2. What does casting mean?
    By sev51 in forum New To Java
    Replies: 3
    Last Post: 01-27-2009, 04:31 PM
  3. casting help
    By soc86 in forum New To Java
    Replies: 4
    Last Post: 01-13-2009, 11:07 PM
  4. Replies: 5
    Last Post: 06-02-2008, 02:32 PM
  5. Casting
    By leebee in forum New To Java
    Replies: 5
    Last Post: 08-10-2007, 12:24 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
  •