public String fillZero(String field, int size){
String res = field;
while(res.length() < size)
res="0"+res;
return res;
}
8/16/2010
Java - How i can ... Iterator List (another example, now with loop "for")
import java.util.List;
import java.util.ArrayList;
public class Teste {
public static void main(String[] args) {
List list=new ArrayList();
list.add("value1");
list.add("value2");
list.add("value3");
for(String iterator : list){
System.out.println("Value: " + iterator);
}
}
}
import java.util.ArrayList;
public class Teste {
public static void main(String[] args) {
List
list.add("value1");
list.add("value2");
list.add("value3");
for(String iterator : list){
System.out.println("Value: " + iterator);
}
}
}
Java - How i can ... Iterator List
import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;
public class List {
public static void main(String[] args) {
List list = new ArrayList();
list.add("value1");
list.add("value2");
list.add("value3");
Iterator it=list.iterator();
while(it.hasNext())
{
String value=(String)it.next();
System.out.println("Value :"+value);
}
}
}
Click Here!
import java.util.List;
import java.util.ArrayList;
public class List {
public static void main(String[] args) {
List
list.add("value1");
list.add("value2");
list.add("value3");
Iterator it=list.iterator();
while(it.hasNext())
{
String value=(String)it.next();
System.out.println("Value :"+value);
}
}
}
Click Here!
7/27/2010
Java - How i can parse String to Integer
String valueString = "123";
int valueInt = Integer.parseInt(value);
int valueInt = Integer.parseInt(value);
Subscrever:
Mensagens (Atom)