All pastes #276602 Raw Edit

Someone

public text v1 · immutable
·published 2006-12-12 15:04 UTC
rendered paste body
import java.lang.*;
import java.util.*;

public class hosts {

	public ArrayList hostnames = new ArrayList();

	public void addHost(String hostname) {
		
		hostnames.add(hostname);
		
		System.out.println("hostname is currently " + hostnames.size() + " in length..");
		
		for(int i=0; i < hostnames.size(); i++) 
		{
			System.out.println("hostnames: " + hostnames.get(i));
		}
		
	}
}






*****OUTPUT******

hostname is currently 1 in length..
hostnames: 1
hostname is currently 1 in length..
hostnames: 2
hostname is currently 1 in length..
hostnames: 3