ITeye博客

MrCrapBag的博客

MrCrapBag · 共 3 篇文章

CarDemo

public class Car { // the car's year model private int yearModel; // the make of the car. private String make; // the car's current speed. private int speed; // no-arg constructor public Car() { yearModel = 2004; make = "Honda"; speed = 0; } // constructor public Car(int yearModel, String make, int…

2013-04-10T22:18:52Z · 编程语言 · 评论(0)

字符串MD5值,适用于大文本的比较

public class Test { protected static char hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; public static void main(String args) { MessageDigest messagedigest; try { messagedigest = MessageDigest.getInstance("MD5"); messagedigest.update("aa".getBytes()); …

2013-04-01T18:15:16Z · 编程语言 · 评论(0)

【扑克牌的洗牌和排序】

用java实现扑克牌的洗牌和排序功能:创建抽象类Card 其中有一个方法showhand()用来输出牌的信息。 新建Card的子类 squard、heart 、diamond、club 其中要有数组包含牌号;然后建立一个game类main在其中,建立char数组包含13张牌,然后生成52张牌 ;然后编写一个washcard() 然后根据花色和数字排序 具体实现如下: /* * 文件名:CardColor.java * 版权:Copyright All Rights Reserved. * 描述: CardColor.java * 修改人:WX * 修改时间:2013-3-26 * 修改内容:…

2013-03-28T21:15:21Z · 编程语言 · 评论(0)