Computers - In Java, I found this setValue() method. What does it do?
- Posted:
- 3+ months ago by hmalsagheer
- Topics:
- computer, java
Answers (3)
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();
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.