Test SimpleList
This commit is contained in:
parent
04ab740290
commit
122e6e27ca
25
src/StruttureDati/SimpleList/Test.java
Normal file
25
src/StruttureDati/SimpleList/Test.java
Normal file
@ -0,0 +1,25 @@
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Test{
|
||||
public static void main(String [] args) throws Exception {
|
||||
Scanner sc = new Scanner(System.in);
|
||||
SimpleList list = new SimpleList();
|
||||
|
||||
System.out.println("Stringa: ");
|
||||
String line = sc.nextLine();
|
||||
|
||||
while(!line.equals("")) {
|
||||
list.addHead(line);
|
||||
System.out.println("Stringa: ");
|
||||
line = sc.nextLine();
|
||||
}
|
||||
|
||||
System.out.println("lunghezza lista: " + list.size());
|
||||
|
||||
while(!list.isEmpty()){
|
||||
line = (String) list.head();
|
||||
System.out.println(line);
|
||||
list.remHead();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user