Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Variable way Parametrized functions

Posted on 2005-04-06
Medium Priority
Last Modified: 2010-03-31

I have noted in javascript is possible be written functions including a variable number of parameters like this:

function Suma(x)
      var sumandos = suma.arguments;
      var num_op = suma.arguments.length;
      var resultado = 0;
      for (var i=0; i<num_op; i++)
            resultado += sumandos[i];
      return resultado;

in same way, in visual c++ is possible to do it. My question is, if is possible in java swing to do this?
Question by:accarvajal
  • 3
LVL 15

Accepted Solution

aozarov earned 80 total points
ID: 13721451
LVL 15

Expert Comment

ID: 13721483
LVL 86

Expert Comment

ID: 13721599
If using prior to Java 1.5, you can use a List or an Object[] to pass the arguments

Author Comment

ID: 13721864
Thanks aozarov! I have java 1.5. points are yours. The only situation I have is due to I develop using eclipse, I noted in its configuration compilation compliance is 1.4. I tried to change it to 1.5 and started showing me a several code errors and warnings than in 1.4 didn't.
LVL 15

Expert Comment

ID: 13721954
You need eclipse 3.1 (currently M6).

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question