import java.io.IOException; import java.io.PipedInputStream; import java.io.PipedOutputStream; public class UTP_3 { public static void main(String[] args) throws IOException { PipedInputStream pis = new PipedInputStream(5); PipedOutputStream pos = new PipedOutputStream(pis); ThreadA receiver = new ThreadA(pis); ThreadB sender = new ThreadB(pos); Thread ra = new Thread(receiver, "ThreadA"); Thread rb = new Thread(sender, "ThreadB"); ra.start(); rb.start(); } }