What is the default value of float and double datatype in Java?

Author Topic: What is the default value of float and double datatype in Java?  (Read 3176 times)

Offline johnmecanse34Topic starter

  • Trade Count: (0)
  • Newbie
  • *
  • Thank You 0
  • Posts: 1
  • Karma: 0
    • JAVA Training in Chennai
Hi,


What is the default value of float and double datatype in Java?

Its my interview question  anyone know the correct answer?

anyone..


Offline xerbotdev

  • Trade Count: (0)
  • Semi-Newbie
  • *
  • Thank You 2
  • Posts: 19
  • Karma: 0
  • Lead Xerbot Developer
    • Xerbot
I assume you are talking about Javascript as you have posted in the Javascript subforum. Java is a completely separate language.

Javascript only has "number", no float/double like in C or C++. The Javascript number is a 64bit floating point number, that means, it is equivalent to a double on most operating systems.
Xerbot Website [nofollow]

Offline uditsh

  • Trade Count: (0)
  • Semi-Newbie
  • *
  • Thank You 0
  • Posts: 28
  • Karma: 0

What is the default value of float and double datatype in Java?


Default value of data type in JAVA:

float: 0.0f

double: 0.0d

 

Related Topics

  Subject / Started by Replies Last post
0 Replies
1121 Views
Last post 09-28-2011, 00:58:35
by linavi390
0 Replies
1192 Views
Last post 10-24-2011, 20:38:42
by abcdf
2 Replies
1372 Views
Last post 07-22-2013, 06:04:56
by stephenj141
3 Replies
3595 Views
Last post 08-19-2015, 01:48:54
by SanviMalhotra
0 Replies
553 Views
Last post 02-01-2016, 01:14:25
by chinmay.sahoo