🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #20027

beginner - why do it this way?

#20027
From: Paul Wheaton
Date: Tue, 04 Nov 1997 00:00
30 lines
1087 bytes
If I want to convert a string to a double, why do all the examples show
 
   String S=args[0];
   double D=Double.valueOf(S).doubleValue();
 
Why not
 
   double D=Double(S).doubleValue();
 
??
 
Next Question:  Why is the isDigit() function called
 
   char C='5';
   if (Character.isDigit(C))   ...
 
So I am calling a class method that refers to no object?  I would
think that it would make more sense to use
 
   Character(C).isDigit()
 
or to have a standalone function
 
   isDigit(C)
 
Just trying to figure out the method to the madness.
 
 
 
Technical Details
Message-ID: <Pine.BSI.3.95.971104123016.27159A-100000@uncle.montana.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <345D827A.2BE8@watchmysite.com> <345e0ca5.2426469@forums.borland.com> <345F57D7.615@watchmysite.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,a29c79fc357c410e
X-Google-Attributes: gidf74b3,public
From: Paul Wheaton <pwheaton@montana.com>
Subject: beginner - why do it this way?
Date: 1997/11/04
Message-ID: <Pine.BSI.3.95.971104123016.27159A-100000@uncle.montana.com>
X-Deja-AN: 287009015
References: <345D827A.2BE8@watchmysite.com> <345e0ca5.2426469@forums.borland.com> <345F57D7.615@watchmysite.com>
Organization: None
Newsgroups: borland.public.jbuilder.java.language