can setter method have more than 1 parameter in JavaBeans?

M

Matt

In JavaBeans, the getter and setter methods always have signatures like this:
public void setXxx(Type xxx)
public Type getXxx()

Can we declare a setter method that takes more than 1 parameter, like
public void mysetter(Type xxx, Type yyy)
This article (http://www.it-careernet.com/itc/javabeantechnology.htm)
in Indexed Properties section has 2 parametes in setter method.

I am confused.

Please advise. Thanks!!
 
H

Heiner Kücker

Matt said:
In JavaBeans, the getter and setter methods always have signatures like this:
public void setXxx(Type xxx)
public Type getXxx()

Can we declare a setter method that takes more than 1 parameter, like
public void mysetter(Type xxx, Type yyy)
This article (http://www.it-careernet.com/itc/javabeantechnology.htm)
in Indexed Properties section has 2 parametes in setter method.

I am confused.

Please advise. Thanks!!

One parameter is the value and one parameter is the index (int).

The index is the position in the underlaying array or collection
by base zero ( 0....* )

Heiner Kuecker
Internet: http://www.heinerkuecker.de http://www.heiner-kuecker.de
JSP WorkFlow PageFlow Page Flow FlowControl Navigation: http://www.control-and-command.de
Expression Language Parser: http://www.heinerkuecker.de/Expression.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top