随笔分类 - 数据结构用-java语言描述-串与数组
摘要:lstring.java //字符串抽象数据类型的接口定义public interface IString { public void clear(); //将一个已经存在的串置成空串 public boolean isEmpty(); //判断当前串是否为空,为空则返回true,否则返回false public int length(); ...
阅读全文
摘要:public class ArrayOfArraysDemo1 { public static void main(String[] args) { int[][] aMatrix = new int[4][]; //populate matrix for (int i = 0; i < aMatrix.length; i++) { ...
阅读全文
摘要:public class ArrayOfStringsDemo { public static void main(String[] args) { String[] anArray = { "String One", "String Two", "String Three" }; for (int i = 0; i < anArray.leng...
阅读全文
摘要:public class ContinueWithLabelDemo { public static void main(String[] args) { String searchMe = "Look for a substring in me"; String substring = "sub"; boolean foun...
阅读全文
摘要:public class BreakDemo { public static void main(String[] args) { int[] arrayOfInts = { 32, 87, 3, 589, 12, 1076, 2000, 8, 622, 127 }; int sea...
阅读全文
摘要:public class WhileDemo { public static void main(String[] args) { String copyFromMe = "Copy this string until you encounter the letter 'g'."; StringBuffer copyToMe = new Strin...
阅读全文
浙公网安备 33010602011771号