Computers - In Java, I found this setValue() method. What does it do?

Answers (3)

Visit this site:
docs.oracle.com/javaee/1.4/api/javax/servlet/http/Cookie(.)html

And scroll down.
You might find something useful.
I'm not adding direct answer because this site will be more helpful to you.
Nice Day. :)

Votes: +1 / -0

The name of method is answer your question. This method is to set value of variable. If you want to get the value, you can use getValue(). You can go to this class, you will find get and set function.

MyObject variable = new MyObject();
variable.setValue("John") ;
variable.getValue();

Votes: +1 / -0

This method sets the value for the control.

Syntax :
public void setValue(java.lang.Object value);
public void setValue(java.lang.String);
public void setValue(long);
public void setValue(double);
public void setValue(boolean);

Parameters :
value : The value to be assigned to the control.

You can applies this method in Image Control, Label Control, CheckBox Control, FileUpload Control, TextArea Control, TextBox Control, Hidden Control, CheckBoxList Control, RadioButton Control, ListBox Control, Link Control, ImageLink controll.

Votes: +0 / -0