2016年4月3日
摘要: ★ 场景和问题 在Java开发时,需要来回交换大量的数据,比如要为方法传入参数,也要获取方法的返回值,该如何能更好的进行数据的交互?★ 基本的编写步骤 ◎第1步:写一个类,实现可序列化(如果以后数据是往数据库里存的,那么可以不序列化,节省资源) ◎第2步:私有化所有属性,保持一个默... 阅读全文
posted @ 2016-04-03 23:32 cnxo 阅读(223) 评论(0) 推荐(0)
摘要: ★ 场景和问题 Java程序开发讲究面向接口编程,隐藏具体的实现类,可是如何得到接口呢?工厂类的命名规范:***Factory 单例工厂方法的命名规范:getInstance()工厂的本质是“选择实现”工厂、接口和实现类之间的技术边界:工厂只负责选择实现,实现类才做真正的实现,而接... 阅读全文
posted @ 2016-04-03 23:07 cnxo 阅读(200) 评论(0) 推荐(0)
摘要: Problem Description 每学期的期末,大家都会忙于计算自己的平均成绩,这个成绩对于评奖学金是直接有关的。国外大学都是计算GPA(grade point average) 又称GPR(grade point ratio),即成绩点数与学分的加权平均值来代表一个学生的成... 阅读全文
posted @ 2016-04-03 13:24 cnxo 阅读(228) 评论(0) 推荐(0)
摘要: Problem Description Find and list all four-digit numbers in decimal notation that have the property that the sum of its four digits equals th... 阅读全文
posted @ 2016-04-03 12:42 cnxo 阅读(102) 评论(0) 推荐(0)
摘要: Problem Description Given an positive integer A (1 =0;i--){ if(str.charAt(i)=='1'){ System.out.println((int... 阅读全文
posted @ 2016-04-03 12:07 cnxo 阅读(116) 评论(0) 推荐(0)
摘要: Problem Description Superbowl Sunday is nearly here. In order to pass the time waiting for the half-time commercials and wardrobe malfunction... 阅读全文
posted @ 2016-04-03 11:43 cnxo 阅读(188) 评论(0) 推荐(0)