Java tutorial
//package com.java2s; import java.util.List; public class Main { public static int getMaxWidth(List<String> list) { int max_width = list.get(0).length(); for (String line : list) { if (line.length() > max_width) max_width = line.length(); } return max_width; } }