11 2021 档案

摘要:package com.lambda;public class Test { static class Believe1 implements IBelieve { //3、静态内部类 @Override public void believe(String s) { System.out.prin 阅读全文
posted @ 2021-11-27 16:35 tuyin 阅读(33) 评论(0) 推荐(0) 编辑
摘要://线程创建方式三:实现callable接口/*callable的好处1、可以定义返回值2、可以抛出异常 */public class TestCallable implements Callable<Boolean> { private String url;//网络图片地址 private St 阅读全文
posted @ 2021-11-27 14:41 tuyin 阅读(79) 评论(0) 推荐(0) 编辑
摘要://创建线程方式一:继承Thread类,重写run()方法,调用start开启线程//总结:线程开启不一定立即执行,由CPU调度执行public class TestThread1 extends Thread { @Override public void run() { //run方法线程体 f 阅读全文
posted @ 2021-11-27 14:08 tuyin 阅读(98) 评论(0) 推荐(0) 编辑
摘要:package com.thread;//模拟龟兔赛跑public class Race implements Runnable { //胜利者 private static String winner; //实现Runnable接口,重写run方法 @Override public void ru 阅读全文
posted @ 2021-11-27 13:57 tuyin 阅读(53) 评论(0) 推荐(0) 编辑
摘要:package com.tu.oop.demo8;//abstract 抽象类:类 extends:单继承~ (接口可以多继承)public abstract class Action { //约束~有人帮我们实现~ //abstract,抽象方法,只有方法名字,没有方法的实现! public ab 阅读全文
posted @ 2021-11-21 17:14 tuyin 阅读(40) 评论(0) 推荐(0) 编辑
摘要:package com.tu.oop.demo7;//staticpublic class Student { private static int age;//静态的变量 private double score;//非静态的变量 public void run(){ } public stati 阅读全文
posted @ 2021-11-21 16:39 tuyin 阅读(30) 评论(0) 推荐(0) 编辑
摘要:package com.tu.oop.demo6;public class Person { public void run(){ System.out.println("Person类执行了!!!"); }}/* //一个对象的实际类型是确定的 //new Student(); //new Per 阅读全文
posted @ 2021-11-21 16:36 tuyin 阅读(39) 评论(0) 推荐(0) 编辑
摘要:super注意点: 1、super调用父类的构造方法,必须在构造方法的第一行! 2、super必须只能出现在子类的方法或者构造方法中! 3、super和this不能同时调用构造方法!VS this: 代表的对象不同: this:本身调用者的这个对象 super:代表父类对象的引用 前提 this:没 阅读全文
posted @ 2021-11-21 16:32 tuyin 阅读(34) 评论(0) 推荐(0) 编辑
摘要:package com.tu.oop.demo2;//java > classpublic class Person { //一个类即使什么都不写,它也会存在一个方法 //显示的定义构造器 //1、必须和类的名字相同 //2、必须没有返回类型,也不能写void String name; int ag 阅读全文
posted @ 2021-11-17 21:38 tuyin 阅读(33) 评论(0) 推荐(0) 编辑
摘要:public class Demo3 { public static void main(String[] args) { //非静态方法调用,类实例化之后才存在,所以应该在new之后再调用 //实际参数和形式参数的类型要对应 int add = new Demo3().add(2, 3); //静 阅读全文
posted @ 2021-11-17 17:46 tuyin 阅读(79) 评论(0) 推荐(0) 编辑
摘要://值传递public class Demo4 { public static void main(String[] args) { int a = 1; System.out.println(a);//1(输出结果) Demo4.change(a); System.out.println(a);/ 阅读全文
posted @ 2021-11-17 17:23 tuyin 阅读(45) 评论(0) 推荐(0) 编辑
摘要:// 写4个方法:加减乘除// 利用循环+ switch进行用户交互// 传递需要操作的两个数// 输出结果 public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.p 阅读全文
posted @ 2021-11-13 23:50 tuyin 阅读(1955) 评论(0) 推荐(0) 编辑
摘要:package com.tu.struct;//整个程序打印出/* * *** ***** ******* ********* ******* ***** *** * */public class TestDemo { public static void main(String[] args) { 阅读全文
posted @ 2021-11-13 16:34 tuyin 阅读(260) 评论(0) 推荐(0) 编辑
摘要:package com.tu.struct;public class ForDemo4 { /* 1*1=1 1*2=2 2*2=4 1*3=3 2*3=6 3*3=9 1*4=4 2*4=8 3*4=12 4*4=16 1*5=5 2*5=10 3*5=15 4*5=20 5*5=25 1*6=6 阅读全文
posted @ 2021-11-13 14:59 tuyin 阅读(1472) 评论(0) 推荐(0) 编辑
摘要:public class Demo1 { public static void main(String[] args) { //整数拓展: 进制 二进制0b 十进制 八进制0 十六进制0x int i = 10; int i2 = 010;//八进制0 int i3 = 0x10;//十六进制0x 阅读全文
posted @ 2021-11-11 16:18 tuyin 阅读(20) 评论(0) 推荐(0) 编辑
摘要:window常用快捷键 打开任务管理器:Ctrl+Shift+Esc 关闭窗口:Alt+F4 切换窗口:win键+Tab 放大镜:win键+“+” 打开cmd方式 开始+window系统+命令提示符 win键+R 输入cmd打开控制台(推荐使用) 在任意的文件夹下面,按住shift键+鼠标右键点击, 阅读全文
posted @ 2021-11-11 16:16 tuyin 阅读(36) 评论(0) 推荐(0) 编辑
摘要:Markdown学习 标题 一级标题(#+空格+标题+回车); 二级标题(##+空格+标题+回车); 三级标题(###+空格+标题+回车) 四级标题(####+空格+标题+回车) 五级标题(#####+空格+标题+回车) 六级标题(######+空格+标题+回车) 最多到六级标题 字体 我是大帅哥! 阅读全文
posted @ 2021-11-05 15:19 tuyin 阅读(81) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示