a program in java bean to implement indexed properties of a bean
Aim: write a program in javabean to implement indexed properties of a bean.
Program:
package sunw.demo.indexed;
import java.awt.*;
import java.io.*;
public class PieC
{
private
double data[ ];
public
double getData(int index)
{
return
data[index];
}
public void
setData(int index, double value)
{
data[index]
= value;
}
public
double[ ] getData( )
{
return
data;
}
public void
setData(double[ ] values)
{
data
= new double[values.length];
System.arraycopy(values,
0, data, 0, values.length);
}
}
Output:
Labels: Advanced Java Lab
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home