Results 1 to 2 of 2
Thread: Hello
- 06-20-2007, 09:22 AM #1
Member
- Join Date
- Jun 2007
- Posts
- 1
- Rep Power
- 0
Hello
hello to every one
Iam new to this forum and iam learning java now
I have a doubt in Java basics
Why ever variable like integer,float etc.that we enter at command line (or)taking variable from keyboard (using InputStramReader and BufferedReader) is taken in string data type in main method.In C/C++ we never do this type of conversion.
Please anyone clear my doubt
- 06-20-2007, 09:40 AM #2levent Guest
That is the standard way for main method, check signatures of main methods in C. It is same with Java....taken in string data type in main method
Because every other variable type is convertable from String! You can also read bytes from files if you want. Reading files line by line or byte by byte is a common practice in C world too as far as i know. I think that is the most generic way of doing this. If you think about this and possible input types/ input files, i guess you will see the same.that we enter at command line (or)taking variable from keyboard (using InputStramReader and BufferedReader)


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks