![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
yonggangsun
这个作者很懒,什么都没留下…
展开
-
浅谈Java与策略模式
1:所谓策略模式就是把算法定义的一组算法封装,把调用与实现分开,在客户端(测试类)中调用它们的时候相互之间不发生影响。它的基础就是多态。2:策略模式的意义:策略模式提供了许多可替换的部分组成的软件,并且各个部分之间是弱连接的关系。弱连接的特性使软件具有更强的可扩展性,易于维护;更重要的是,它大大提高了软件的可重用性。3:策略模式的组成:1:抽象的策略角色,抽象的策略角色可以设置原创 2012-07-24 11:22:33 · 692 阅读 · 0 评论 -
JAVA判断字符串为数字的判断
下面有四种方法,估计好用的应该是第三种吧。1.用JAVA自带的函数 public static boolean isNumeric(String str){ for (int i = str.length();--i>=0;){ if (!Character.isDigit(str.charAt(i))){return false; } }return true;转载 2012-10-13 15:40:52 · 426 阅读 · 0 评论 -
CODEFORCES:1B. Spreadsheets
接着上次的说,我是在做这一题的时候才发现CODEFORCES上有submissions这一个选项,可以查看自己在哪一步出了错误;接下来直接入主题,来看看这道题:“In the popular spreadsheets systems (for example, in Excel) the following numeration of columns is used. The firs原创 2012-11-11 16:48:59 · 1721 阅读 · 0 评论 -
CODEFORCES 2A-Winner
这是codeforce上的2A,被这道题折磨了很长一段时间,想想就很不爽。。。。关于这道题目,更详细的地方看这里:A. Winner;好了,不发牢骚直接进入主题,首先来看看这道题目:The winner of the card game popular in Berland "Berlogging" is determined according to the following ru原创 2012-12-09 16:13:07 · 771 阅读 · 0 评论