Java: Java Programming For Beginners a simple Start To Java Programming (Written By a software Engineer)


Conversion of One Data Type to Another


Download 0.82 Mb.
Pdf ko'rish
bet88/95
Sana09.01.2022
Hajmi0.82 Mb.
#261112
1   ...   84   85   86   87   88   89   90   91   ...   95
Bog'liq
Java Programming For Beginners - A Simple Start to Java Programming ( PDFDrive )

Conversion of One Data Type to Another
The prompt function discussed in the previous function returns a string. However, you had
asked the user to enter a number. In such a scenario, a string to number conversion may be
required.  In  JavaScript,  a  variable  can  be  converted  from  one  type  to  another  using  the
following functions:
Number Function
This function converts the object supplied to it into number data type. However, if
the function is unable to perform the conversion, NaN is returned.
String Function
This function converts the object supplied to it into string data type.



Download 0.82 Mb.

Do'stlaringiz bilan baham:
1   ...   84   85   86   87   88   89   90   91   ...   95




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling