⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 linkedlistdemo.java

📁 本压缩文件中含有线程的控制
💻 JAVA
字号:
package c10;

public class LinkedListDemo {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
//		StringLinkedListSelfcontained list = new StringLinkedListSelfcontained();
		StringLinkedListWithIterator list = new StringLinkedListWithIterator();
		list.addANodeToStart("one");
		list.addANodeToStart("two");
		list.addANodeToStart("three");
		
		System.out.println("List has " + list.length() + "entries");
		
		list.showList();
		list.resetIteration();
		
		while(list.moreToIterate()){
			if (list.getDataAtCurrent().equals("two")){
				list.insertNodeAfterCurrent("added data");
				break;
			}
			list.goToNext();
		}
		
		list.showList();
		
//		if(list.onList("three")){
//			System.out.println("three is on list.");
//		}else{
//			System.out.println("three is NOT on list.");
//		}
//		
//		list.deleteHeadNode();
//		
//		if(list.onList("three")){
//			System.out.println("three is on list after deleted the head node.");
//		}else{
//			System.out.println("three is NOT on list after deleted the head node.");
//		}
		
//		list.showList();
		

	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -