an class will be run under a mutilthreaded environ,the class like this
public class ReportEngine
{
private HashMap publicReport;
private Report getReportData(
String reportKey) {
return publicReport.get(reportKey);
}
private void deleteReport(String reportKey) {
publicReport.remove(reportKey);
}
private void addReport(String reportKey,Report report) {
publicReport.add(reportKey,report);
}
}
So, what I am puzzled are:
1)which methods need synchronized ?
2)what will happen if don't synchronize any methods ?