13_Review Lecture

The second thread prints the letter b 100 times the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: t<ClassA> l){! for(ClassA a:l)! a.toString();! }! ! replace(ArrayList<ClassA> l, ClassA a){! l.set(l.size(),a);! }! ! 23 Generic Methods public sta4c <E> void print(E list) { for (int i = 0; i < list.length; i++) System.out.print(list[i] + " "); System.out.println(); } public sta4c void print(Object list) { for (int i = 0; i < list.length; i++) System.out.print(list[i] + " "); System.out.println(); } GenericMethodDemo 24 Mul4- threading Review points •  Use Runnable interface and Thread API to start parallel work •  Know how sleep/join work •  The concept of race condi4on •  The concept of cri4cal regions and locks •  The use of Java built- in locks (Monitor): –  “synchronized” syntax –  wait an...
View Full Document

This document was uploaded on 03/11/2014.

Ask a homework question - tutors are online