Passing unlimited arguments to methods in Java

JianJunShen
JianJunShen used Ask the Experts™
on
Hi: I have a Java method, actually a log, yes, I want to exercise how to write log by myself. The user could pass at least one parameter, then it depends on situation, user could pass two, three or 4 arguments. How to write Java method which could accept argument which knowing exactly how many arguments are? Any link in Java tutorial?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
a_b
Top Expert 2009
Commented:
a_b
Top Expert 2009
Commented:
Top Expert 2016
Commented:
You should use a proper logging framework which supports what you want to do. Don't reinvent the wheel - logging is not trivial to do properly.

http://logback.qos.ch
Top Expert 2016

Commented:
:-)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial