1 今天看网课
1 package liuer; 2 import java.util.ArrayList; 3 import java.util.List; 4 5 public class listDemo { 6 public static void main(String[] args){ 7 List<String> l=new ArrayList<String>(); 8 l.add("Hello"); 9 System.out.print(l); 10 } 11 }
2 有点问题 运行不出 后来解决了
1 package liuer; 2 import java.io.FileInputStream; 3 import java.io.FileNotFoundException; 4 5 public class ExceptionDemo { 6 public static void main(String[] args)throws FileNotFoundException{ 7 try{ 8 FileInputStream in=new FileInputStream("a.txt"); 9 }catch(FileNotFoundException e){ 10 e.printStackTrace(); 11 System.out.println("失败! "); 12 }finally{ 13 System.out.println("成功!"); 14 } 15 } 16 }
3 明天开始学习web