hi to everybody...
please tell me that why does Java takes input in the form of String??
Post by:Devaka Cooray
, Marshal
akhilesh bar wrote:why does Java takes input in the form of String??
What input? If the input is a text, String would be the best way to get it because String can hold a text.
Post by:akhilesh bar
, Greenhorn
hi devaka..
according to my knowledge... java takes inputs as a string and then converts it into the desired type...for example static void main(String [] args) !!!
Post by:Wouter Oet
, Bartender
You're referring to command-line arguments. That's because java uses the String to hold text.
"Input" is very imprecise. Could you specify what do mean exactly.
Post by:fred rosenberger
, Bartender
because anything and everything you type from a keyboard CAN be represented as a String...but the same isn't really true for other variable types.
That's what I've always thought.
Post by:Ninad Kuchekar
, Ranch Hand
Hi Akhilesh,
Please be specific with your subject...thanks in advance.
If you are passing arguments from the console then they have to be accepted as text(in this case String format).
Even if you type in a number you have to parse the String to the desired format.
Post by:autobot
PI day is 3.14 (march 14th) and is also einstein's birthday. And this is merely a tiny ad:
Thread Boost - a very different sort of advertising