示例#1
0
 public static void testingList() {
   List l = new List();
   l.add(4);
   l.add(7);
   l.add(2);
   l.add(3);
   l.add(9);
   l.remove(1);
   l.print();
   // l.duplicate();
   // l.invert();
   // l.removeFirst();
 }
示例#2
0
 /**
  * Prints this Item as a textual representation, with the given String put before every line.
  *
  * @param pre - the String to put in front of each line
  */
 public void print(String pre) {
   if (type == Type.String) System.out.println(stringValue);
   if (type == Type.Integer) System.out.println(integerValue);
   if (type == Type.Double) System.out.println(doubleValue);
   if (type == Type.Record) {
     System.out.println("Record\r\n" + pre + "[");
     recordValue.print(pre + "  ");
     System.out.println(pre + "]");
   }
   if (type == Type.List) {
     System.out.println(" List");
     listValue.print(pre);
   }
 }
示例#3
0
文件: main.java 项目: kinley/ads_1
 public static void main(String[] args) throws FileNotFoundException {
   List stroka = new List(); // переменная класса
   stroka.get_string(); // считали из файла строки
   stroka.z_exception(); // исключили из них слова, начинающиеся на 'z'
   stroka.print(); // вывели
 }