Handson - File Handling and Multithreading
Handson - File Handling and Multithreading
import java.io.*;
-----------------------------------------------------------------------------------
--------------------------
Counting the Word in the given file
import java.io.*;
import java.util.*;
import java.text.*;
while((s=bfr.readLine())!=null) {
buffer = s.split(" ");
for(int i=0;i<buffer.length;i++){
if(buffer[i].equalsIgnoreCase("Knowledge")){
++cnt;
}
}
}
System.out.println(cnt);
}
catch(IOException e){
e.printStackTrace();
}
}
}
-----------------------------------------------------------------------------------
----------
Persist Employee
import java.io.Serializable;
this.employeeId = empid;
this.name = name;
this.appraisalRating=appraisalRating;
}
import java.io.*;
import java.util.ArrayList;
return true;
}
catch(IOException ignore){
}
return false;
}
}
return null;
}
import java.util.ArrayList;
import java.util.Arrays;