0
   

In java 1.7 Setter Method

 
 
Rhyan
 
Reply Mon 2 Jul, 2012 10:21 pm
In java 1.7 how to write getter and setter method for "property='<%= "duration[" + ind + "]" %>'"

If i am using the below methods

public String setDuration(int index, String duration) {

System.out.println("Index==>"+index);
System.out.println("Duration==>"+duration);

// make sure list is not null
if (this.durationList == null) {
this.durationList = new ArrayList();
}

// indexes do not come in order, populate empty spots
while (index >= this.durationList.size()) {
this.durationList.add(new String());
}

// return the requested item
return (String) durationList.set(index, duration);

}

It is not working. Please any one can help me to resolve this problem.
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 1,918 • Replies: 0
No top replies

 
 

Related Topics

 
  1. Forums
  2. » In java 1.7 Setter Method
Copyright © 2020 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 08/10/2020 at 10:48:50