I've been learning scheme for some time and I have no experience on compiled languages. Since scheme is an interpreted and function-based language, I had difficulties to get the basics of java. For example I have an assignment supossed to be written in java that is a function which takes an array and returns a specific element of it. Do I have to work in a class environment such as the array class or another one? What are the ways of giving the input array to the function? I just need to learn the basics but all the tutorials I come across only talks about classes and objects.
Great, I think I'm getting it. I managed to work this code:
The purpose of the code doesn't matter much. I'm just trying to learn to call some method of a class. So far so good I guess. But how will I send an array of integers as command line argument instead of an integer?
edit:--Sorry, what I really need is to read numbers from command line into an array until something which is not a number appears (empty line). I will try to sort it out. If I can't it, I'll be back then.
[ December 13, 2008: Message edited by: mehmet emin ] [ December 13, 2008: Message edited by: mehmet emin ]
You already have an array with the command line arguments. It's the "String args" part. You just need to convert its elements into ints. You should check java.lang.Integer for some useful methods for that.