P Ankireddy
"JavaRanch, where the deer and the Certified play" - David O'Meara
Read about me at frankcarver.me ~ LinkedIn ~ Frank's PhD research
P Ankireddy
P Ankireddy
P Ankireddy
Read about me at frankcarver.me ~ LinkedIn ~ Frank's PhD research
"JavaRanch, where the deer and the Certified play" - David O'Meara
Originally posted by praveen ankireddy:
I want to implement the variable arguments the one present in c and C++ in java can any one suggest a method or any help from API to implement this.Hope everybody knows about variable arguments.for those who dont know it is as follows.
im explaining this in context of c:
in c for example take printf() funciton or scanf().
it accepts any number of arguments.
the same way i want it in java is there any method plz
let me know
Thanks
PRaveen Ankireddy
P Ankireddy
P Ankireddy
Read about me at frankcarver.me ~ LinkedIn ~ Frank's PhD research
"JavaRanch, where the deer and the Certified play" - David O'Meara
Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
P Ankireddy
P Ankireddy
An array is in fact a viable answer because arrays in Java can be sized at runtime.
Read about me at frankcarver.me ~ LinkedIn ~ Frank's PhD research
Originally posted by Software Engg:
Answering your question.I dont know y the compiler cant handle this variable arguments,but i think the people who have developed compiler has not considered this issue while developing.May b somebody should change and develop a new one.I think so if something wrong in my opinion plz forgive me
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Originally posted by Frank Carver:
I don't quite understand why anyone would thing that the syntax of creating a new array on the fly somehow limits the number of elements that array may contain.
As far as I can see, the main difference between this syntax for variable argument passing and the style used in C and C++ is the extra typing required to say "new Object[] {" before the argument list, and "}" after it. Is this really so bad?
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
"JavaRanch, where the deer and the Certified play" - David O'Meara
Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Henrik Bengtsson<P>M.Sc. Computer Science<BR>Ph.D. student in Statistics<BR>Lund University, Sweden<BR>h e n r i k b @ b r a j u . c o m
Don't get me started about those stupid light bulbs. |