Users users = new Users();和Class clazz = Users.class;这两种创建对象的方式没有差别吗?都只是创建了Users类的对象啊
老师上课查的那个api文档从哪下啊?
为啥资料下载了打开总是乱码
视频list部分在for循环里第两次调用it2.next()方法是不是错写成了it.next(),,,,我在idea里试的时候再多写一个it2.next()只是不显示B,D--------为啥嘞??
老师,什么时候使用try catch 什么时候try with resource 我还是没听明白额
public <泛型表示符号> void showMsg(泛型表示符号... agrs){}
已经定义泛型啦,为啥还要加void?
一个守护线程可以同时守护几个用户线程,是随着最后一个用户线程消亡而消亡吗?
画红线的地方为什么泛型有的时候用类名有的时候用用integer这类啊
为啥泛型有的时候用类名有的时候用integer这类啊 可以讲解下吗
划红线的地方为什么可以这么用 怎么来的 可以解释一下吗
package com.itbjsxt.TestThread; class A implements Runnable{ private Thread C; public A(Thread C){ this.C = C; } @Override public void run() { for (int i =0;i<10;i++){ System.out.println(Thread.currentThread().getName()+"A"+i); if (i ==5){ try { C.join(); } catch (InterruptedException e) { throw new RuntimeException(e); } } try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } } } class B implements Runnable{ @Override public void run() { for (int i =0;i<15;i++){ System.out.println(Thread.currentThread().getName()+"B"+i); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } } } public class ThreadTest1 { public static void main(String[] args) throws InterruptedException { Thread t1 = new Thread(new B()); Thread t = new Thread(new A(t1)); t.start(); t1.start(); for (int i =0;i<15;i++) { System.out.println(Thread.currentThread().getName() + " " + i); if (i ==2){ t.join(); } } try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } } 请问一下老师,这里面用到的this.C和直接C.join()执行结果一样那两者有什么区别呢,我不是很理解this
老师
DataFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
这个类型转换的话,对软件的版本有需求吗,为什么我的会提示我SimpleDateFormat无法转换为DataFormat,必须是SimpleDateFormat去new一个SimpleDateFormat,或者DataFormat去new一个DataFormat,而且像上面那么声明以后没有parse这个方法,请老师指点。
代码原图--报错
代码原图--修改之后
package com.Han; import java.io.FileInputStream; import java.io.IOException; public class Test2 { public static void main(String[] args) { FileInputStream fis = null; try{ fis = new FileInputStream("d:/mycode/aa/a.txt"); StringBuilder sb = new StringBuilder(); int temp = 0; while((temp = fis.read()) != -1){ sb.append((char) temp); } System.out.println(sb); }catch(Exception e){ e.printStackTrace(); }finally{ try{ if(fis != null) { fis.close(); } } catch (IOException e){ e.printStackTrace(); } } }
这是属于什么类型问题
为啥这里可以输出oldlu啊 明明没用到输出啊
红线部分的知识点是啥来着 可以解释一下吗
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637