資源簡介
此段程序能自動生成通話記錄
主叫+被叫+通話日期+通話時間
代碼片段和文件信息
package?com.it18zhang.callloggen;
import?java.io.FileWriter;
import?java.text.DecimalFormat;
import?java.text.SimpleDateFormat;
import?java.util.*;
import?java.util.Date;
/**
?*
?*/
public?class?App?{
????static?Random?r?=?new?Random();
????public?static?List?phoneNumbers?=?new?ArrayList();
????public?static?Map?callers?=?new?HashMap();
????static{
????????callers.put(“15810092493“?“史玉龍“);
????????callers.put(“18000696806“?“趙賀彪“);
????????callers.put(“15151889601“?“張倩?“);
????????callers.put(“13269361119“?“王世昌“);
????????callers.put(“15032293356“?“張濤“);
????????callers.put(“17731088562“?“張陽“);
????????callers.put(“15338595369“?“李進全“);
????????callers.put(“15733218050“?“杜澤文“);
????????callers.put(“15614201525“?“任宗陽“);
????????callers.put(“15778423030“?“梁鵬“);
????????callers.put(“18641241020“?“郭美彤“);
????????callers.put(“15732648446“?“劉飛飛“);
????????callers.put(“13341109505“?“段光星“);
????????callers.put(“13560190665“?“唐會華“);
????????callers.put(“18301589432“?“楊力謀“);
????????callers.put(“13520404983“?“溫海英“);
????????callers.put(“18332562075“?“朱尚寬“);
????????callers.put(“18620192711“?“劉能宗“);
????????phoneNumbers.addAll(callers.keySet());
????}
????public?static?void?main(String[]?args)?throws?Exception?{
????????if(args?==?null?||?args.length?==?0){
????????????System.out.println(“no?args“);
????????????System.exit(-1);
????????}
????????genCallLog(args[0]);
????}
????public?static?void?genCallLog(String?logFile)?throws?Exception?{
//????????FileWriter?fw?=?new?FileWriter(“G:\小象學院\大數據\“true);
????????FileWriter?fw?=?new?FileWriter(logFiletrue);
????????while(true){
????????????//取主叫
????????????String?caller?=?phoneNumbers.get(r.nextInt(callers.size()));
????????????//主叫名字
????????????String?callerName?=?callers.get(caller);
????????????//被叫號
- 上一篇:騰訊人臉識別demo
- 下一篇:android仿淘寶收貨地址demo
評論
共有 條評論