I have very basic question on java.does anyone know how to read data from the comman line.for examle in C language>gcc p1.c>a.out Testand we can read use string "Test" so now i am wondering how do we dothat in Java. Any idea.. i really dont know how to do that.
You need to find a good java introductory book.Test.java:public class Test{public static void main(String[] args){for (int i = 0; i < args.length; i++)System.out.println("Argument " + i + ": " + args[i]);}}
If you want to learn Java, forget the C or C++, Read any Java bookwithout comparing with C and you will understand . C is old and notgood realized Language. C can do any things but it isn’t understandablelanguage.
I don't agree with you at all here. Much of the syntax and structurein Java was derived from C. So basically anyone that knows C shouldbe able to learn Java MUCH faster than someone that doesn't know anylanguage. I coded with C/C++ for many years before learning Java andI found it to be a fairly smooth transition. The only thing that isREALLY different is the mindset of OOP.
I would have to agree, I do mostly Java coding here but on occasion wedo C++ stuff. It all comes down to the best tools for the job, andsometimes c/c++ is the best tool for the job.