package labPT;

class PTB0 {
	String[] data;

	public PTB0(String parm) {
		data=PTData.getData(parm);
	}

	public String getShortest() {
		if (data==null || data.length==0) return "";
		String shortest=data[0]; // must be a data[0] if we get here
		for(String word : data) {
			if (word.length() < shortest.length()) shortest=word;
		}
		return shortest;
	}

	public void printData() {
		for(String word : data) System.out.println(word);
	}

	public static void main(String[] args) {
		PTB0 obj = new PTB0("B0");
		obj.printData();
		System.out.println("Shortest word: " + obj.getShortest());
	}
}