//------------// Introduction to Programming Using Java: An Object-Oriented Approach//	Arnow/Weiss//------------// the readMovie method// Chapter 14, Section 14.3, Page 684// MODIFICATIONS://    We have wrapped readMovie in a minimal Movie class and//    added a main method for demo purposesimport java.io.*;class Movie {	Movie(String name, int playingTime) {		this.name = name;		this.playingTime = playingTime;	}	void show() {		System.out.println(name+":"+playingTime); System.out.flush();	}	static Movie readMovie(BufferedReader br) throws IOException {		String name;		int    playingTime;		Movie  newMovie;		name = br.readLine();		if (name==null)			return null;		try {			playingTime = Integer.parseInt(br.readLine());		} catch (NumberFormatException e) {			System.err.println("Bad playingTime format for "+name);			throw e;		}		newMovie = new Movie(name,playingTime);		return newMovie;	}	String	name;	int	playingTime;	public static void main(String[] a) throws IOException {		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));		Movie	m = Movie.readMovie(br);		while (m!=null) {			m.show();			m = Movie.readMovie(br);		}	}}