在递归调用copyDir()方法的时候,两个参数分别是srcDir+"\\"+file.getName())和new File(targetDir+"\\"+file.getName())。这里拼接的是一个文件的地址,但是copyDir()方法要求的是两个目录的址。
最后为什么还能复制成功?
希望老师能解答一下。
这里都属于数据结构里面的东西,不理解影响后面学习吗 ?
老师,这个地方为什么要采用[]将image_url括起来
老师请问视频里:
当newCapacity等于15时,执行完第一个if语句15-10<0返回为false之后为什么不执行第二个if语句?
而是直接copy了呢?
照着代码打的,不知道哪错了
package cn.lsq.server; import java.util.List; import java.util.Map; import cn.lsq.servlet.Servlet; public class WebApp { private static ServletContext contxt; static { contxt = new ServletContext(); //分别获取对应关系的Map集合 Map<String, String> servlet = contxt.getServlet(); Map<String, String> mapping = contxt.getMapping(); //创建解析XML文件对象 WebDom4j web = new WebDom4j(); web.parse(web.getDocument());//解析XML //获取解析XML之后的List集合 List<Entity> entityList = web.getEntityList(); List<Mapping> mappingList = web.getMappingList(); //将List集合的数据存储到Map集合 for(Entity entity : entityList) { servlet.put(entity.getName(), entity.getClazz()); } for(Mapping map:mappingList) { List<String> urlPattern=map.getUrlPattern(); for(String s:urlPattern) { mapping.put(s,map.getName()); } } } public static Servlet getServlet(String url) { if ((url == null) || (url.trim().equals(""))) { return null; } try { String servletName = contxt.getMapping().get(url); String servletClass = contxt.getServlet().get(servletName); Class<?> clazz=Class.forName(servletClass); Servlet servlet = (Servlet)clazz.newInstance(); return servlet; } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } public static void main(String[] args) { System.out.println(getServlet("/log")); } }
老师我的文本文档中保存的是一句中文,它报错了。我该怎么解决呐?
老师我这样写为什么不能输出文件中的内容。我这张图截取时,文本文档中有一句英文
老师,这一章节资料的链接失效了,可以麻烦您再发一遍么?
第二十一行代码为什么会报异常?
我没按照视频那样写 直接输出ois.readObject();
package com.bjsxt.Object2; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.util.ArrayList; public class TestClasses { public static void main(String[] args) { //write(); read(); } public static void read() { ObjectInputStream ois = null; try { ois = new ObjectInputStream(new FileInputStream("E:\\object3.txt")); System.out.println(ois.readObject()); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }finally { if(ois!=null) { try { ois.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } public static void write() { //创建班级对象 ArrayList<Student> al = new ArrayList<Student>(); al.add(new Student("marry", 29, "888888")); al.add(new Student("lili", 23, "123456")); al.add(new Student("jack", 20, "654321")); Classes c1 =new Classes("jn101", al); //创建对象输出流 ObjectOutputStream oos = null; try { oos = new ObjectOutputStream(new FileOutputStream("E:\\object3.txt")); oos.writeObject(c1); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }finally { //关闭流 if(oos!=null) { try { oos.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } } }
老师,使用Python管理数据库是不是无法看到数据库的内容,比如说我想查看表内数据,想看的话是不是要经过Navicat去看
老师在pycharm代码没打错,为什么运行不了?
老师,不知道为什么创建不了maven项目
老师,现在手写服务器项目的知识后面还会有吗?我好多知识都感觉一开始学的时候迷糊,但是后面学的课程多了,自然而然的就感觉慢慢理解了,现在这部分知识还是有点懵,我想知道后面还会经常用到么?
上课讲课用的word文档版书在哪能找到?我想看看那里面的代码
老师,为什么这里print输出值不一样,上面直接输出list.sort(a)会为一个空值呢?
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637