IOUtils和 FileUtils中有没有可以copy整个文件夹的方法
老师,在安装好ActiveMQ后,启动出现了一个异常,异常如下截图:
我正在百度上查看了下解决方法,没成功
这样定义time这个成员变量为什么run()方法每次被调度时,time都会累加而不是初值呢?
请问一下,在线程池执行大量Callable任务时,采用10个线程的线程池,为什么加了List集合之后效率就提高了呢?
老师,在eclipse里点Collection就出现集合的所有方法,怎么做到的?
老师,这个错误是什么原因,我写了oracle.jdbc.oracleDriver了啊
老师好,我在测试这一节最后的用ftp显示某个图片的时候,一开始发现输入完用户名和密码后不显示,然后我把Linux系统中的防火墙关闭了,图片就显示出来了,问题是我已经原原本本的按照视频中老师说的在防火墙相关文件中 将21端口不再拦截,下面附图一张,想问下老师这一般是什么原因?
提问:为什么老师要用循环来读取到数组,用循环从数组输出?那不是一次就读进来了的吗?
int len=0; while ((len=fr.read(cbuf))!=-1) { System.out.println(new String(cbuf,0,len)); System.out.println("运行一次"); }
运行结果:
可以看到只循环了一次,使用循环没有意义
老师,我照着视频安装步骤来然后出现了和视频中安装目录不一样,安装截图如下:
红框圈出来的地方和时视频教程中的不一样
我的/usr/local/的目录如下图,也不一样:
然后里面有很多层目录,
一直到这里才发现这个目录,然后我试着后续视频中的启动nginx,出现了这个错误:
在网上查找解决方法未果,急需求救老师帮助。
既然泛型信息在编译之后被全部擦除,为什么还能通过反射读取泛型信息呢?
使用打包插件进行Install的时候报错
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:single (make-assembly) on project dubbo-user-service: Execution make-assembly of goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:single failed: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-assembly-plugin:jar:2.2-beta-5 -> org.apache.maven.shared:maven-common-artifact-filters:jar:1.1: Failed to read artifact descriptor for org.apache.maven.shared:maven-common-artifact-filters:jar:1.1: Could not transfer artifact org.apache.maven.shared:maven-common-artifact-filters:pom:1.1 from/to nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public): RSA premaster secret error: SunTls12RsaPremasterSecret KeyGenerator not available -> [Help 1][ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.[ERROR] Re-run Maven using the -X switch to enable full debug logging.[ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
按照顺序启动服务器和客户端后,在客户端输入内容却没有收到打印的消息,这是因为什么呢,刚刚对着源码看也没找到什么不一样的,老师帮忙看看呗
输入后的效果图
源码压缩包
MyChatClient3.zip
MyChatServer3.zip
为啥开始定义的List类型的泛型是String类型,List<String> alist=new ArrayList<String>();
使用反射获取add方法时参数是Object类型,Method m=c.getDeclaredMethod("add", Object.class);
最后执行add方法时参数又变成了Integer类型,m.invoke(alist, 123);
----------------------------
老师,视频里的代码到我的电脑里就报错空指针?
package com.bjsxt.testfile; import java.io.File; public class TestFile { public static void main(String[] args) { File f=new File("D:\\"); printFile(f, 0); } public static void printFile(File file,int level){ //打印树状结构的层次关系 for(int i=0;i<level;i++){ System.out.print("-"); } //输出目录或文件的名称 System.out.println(file.getName()); if(file.isDirectory()){ //判断File对象是否是目录 File [] listFiles=file.listFiles(); for(File temp:listFiles){ //自己调用自己 printFile(temp,level+1); } } } }
UC截图20190205174450.png
提问:为什么使用indexOf()和nextIndex()获取的元素的下标不一样?
public static oid main(String[] args) { ArrayList al = new ArrayList(); al.add("123"); al.add("-"); al.add("kk"); System.out.println("集合中的所有元素:"+al); System.out.println("######使用indexOf()获取元素下标"); System.out.println("123的下标为:"+al.indexOf("123")); System.out.println("‘-’的下标为:"+al.indexOf("-")); System.out.println("'kk'的下标为:"+al.indexOf("kk")); System.out.println("######使用nextIndex()"); ListIterator it = al.listIterator(); while(it.hasNext()) { Object obj = it.next(); System.out.print("当前元素为:"+obj+"下标为:"); System.out.println (it.nextIndex()+"\t"); //使用nextIndext获取下标 if(it.nextIndex()==0) { it.set("sahbi"); } } }
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637