Results 1 to 3 of 3
  1. #1
    Manfizy's Avatar
    Manfizy is offline Senior Member
    Join Date
    Nov 2008
    Location
    Germany
    Posts
    193
    Rep Power
    6

    Post primitive Data types

    Is there a difference between
    Double
    and
    double
    I use both in my programs but i am not aware if there is a difference between the two:p
    We Learn Through Mistakes..,
    Manfizy:rolleyes:

  2. #2
    Mr.Beans's Avatar
    Mr.Beans is offline Senior Member
    Join Date
    Apr 2009
    Location
    Virginia Beach, Virginia
    Posts
    149
    Rep Power
    0

    Default

    double is a primitive and Double is a class.

    The Double class is just a wrapper class for the double primitive.

    You should take a look at the java-doc for a Double.
    Last edited by Mr.Beans; 07-07-2009 at 06:38 PM.

  3. #3
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    7

    Default

    Hey Manfizy.

    You could use them interchangeably because Java supports auto-boxing, that is, it automatically converts between the primitive data types and their wrapper classes. Nice for serialization and other uses. ;)
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

Similar Threads

  1. Returning complex data types from a web method
    By Tshegofatsom in forum Advanced Java
    Replies: 6
    Last Post: 05-15-2009, 03:30 PM
  2. Array of different data types?
    By venkatteshb in forum New To Java
    Replies: 1
    Last Post: 08-27-2008, 05:42 PM
  3. Replies: 0
    Last Post: 04-17-2008, 07:36 PM
  4. Primitive data types of Java
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-28-2008, 07:29 PM
  5. Converting data types
    By bluekswing in forum New To Java
    Replies: 4
    Last Post: 01-12-2008, 12:48 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
  •