随笔分类 -  数据结构用-java语言描述-串与数组

摘要:lstring.java //字符串抽象数据类型的接口定义public interface IString { public void clear(); //将一个已经存在的串置成空串 public boolean isEmpty(); //判断当前串是否为空,为空则返回true,否则返回false public int length(); ... 阅读全文
posted @ 2013-08-24 16:59 elite_2012 阅读(1387) 评论(0) 推荐(0)
摘要:public class ArrayOfArraysDemo1 { public static void main(String[] args) { int[][] aMatrix = new int[4][]; //populate matrix for (int i = 0; i < aMatrix.length; i++) { ... 阅读全文
posted @ 2013-07-18 15:11 elite_2012 阅读(411) 评论(0) 推荐(0)
摘要:public class ArrayOfStringsDemo { public static void main(String[] args) { String[] anArray = { "String One", "String Two", "String Three" }; for (int i = 0; i < anArray.leng... 阅读全文
posted @ 2013-07-18 15:09 elite_2012 阅读(493) 评论(0) 推荐(0)
摘要:public class ContinueWithLabelDemo { public static void main(String[] args) { String searchMe = "Look for a substring in me"; String substring = "sub"; boolean foun... 阅读全文
posted @ 2013-07-18 15:08 elite_2012 阅读(196) 评论(0) 推荐(0)
摘要:public class BreakDemo { public static void main(String[] args) { int[] arrayOfInts = { 32, 87, 3, 589, 12, 1076, 2000, 8, 622, 127 }; int sea... 阅读全文
posted @ 2013-07-18 15:05 elite_2012 阅读(480) 评论(0) 推荐(0)
摘要:public class WhileDemo { public static void main(String[] args) { String copyFromMe = "Copy this string until you encounter the letter 'g'."; StringBuffer copyToMe = new Strin... 阅读全文
posted @ 2013-07-18 15:03 elite_2012 阅读(260) 评论(0) 推荐(0)