You are not logged in. Please login at www.codechef.com to post your questions!

×

Writing own parse functions in Java.

Hello Everyone, I have seen many programmers write their own functions to convert String into integer, float or double, when they code in Java. I want to ask just one thing that is it faster than using built in functions provided by Java? Please bear with the question if you find it very childish or basic.

asked 02 Aug '16, 10:55

nitin2n33's gravatar image

2★nitin2n33
114
accept rate: 0%


class Convert{ public static void main(String[] args) { String s="123"; double d; float f; int i; i=Integer.parseInt(s); d=Double.parseDouble(s); f=Float.parseFloat(s); System.out.println(i +" " +d +" "+f) } }|

link

answered 02 Aug '16, 11:11

akshaykpm119's gravatar image

0★akshaykpm119
1
accept rate: 0%

even i have the same doubt!

link

answered 02 Aug '16, 22:20

tarun_174's gravatar image

2★tarun_174
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×1,314
×643
×41
×37
×34
×29
×17
×4

question asked: 02 Aug '16, 10:55

question was seen: 728 times

last updated: 02 Aug '16, 22:20