摘要: 第四章 算数运算符 运算代码: public class ArithmeticOperators{ public static void main(String[] args){ int i = 10/4;//数学中得2.5 java中得2 double d = 10/4;//int->double 阅读全文
posted @ 2023-02-09 20:23 iiuu也一样 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 第三章 变量 数据类型 浮点数 public class FloatDetail{ public static void main(String[] args){ double f = 2.7; double ff = 8.1/3; if(ff==f){ System.out.println("两数 阅读全文
posted @ 2023-02-07 22:39 iiuu也一样 阅读(35) 评论(0) 推荐(0) 编辑
摘要: JAVA概述 07快速入门 p21转义字符 public class Chang{ public static void main(String[] args){ System.out.println("贵州\t贵阳\t花溪"); System.out.println("我要开始学习了\n不然找不到 阅读全文
posted @ 2023-02-06 21:41 iiuu也一样 阅读(12) 评论(0) 推荐(0) 编辑
摘要: ArrayList /** * 不同类的对象不能进行比较语法上通不过 */ import java.util.*; public class TestList { public static void main(String[] args){ List l = new ArrayList(); // 阅读全文
posted @ 2022-02-22 18:07 iiuu也一样 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 文件流 import java.io.FileReader; public class TestFile { public static void main(String[] args)throws Exception{ FileReader f = new FileReader("D:\\b站马士 阅读全文
posted @ 2022-02-17 01:11 iiuu也一样 阅读(282) 评论(0) 推荐(0) 编辑
摘要: 线程1 创建线程的第一种方法 public class TestThread { public static void main(String[] args) { A a = new A(); TestThread t = new TestThread(); a.start();//执行完成就重新创 阅读全文
posted @ 2022-02-14 02:16 iiuu也一样 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 1,String类 /* 统计一个String类对象字符串,大写字母,小写字母,非字母出现的次数 */ public class Test2 { public static void main(String[] args){ // //方法一 // String s = "abDJD, slkSDH 阅读全文
posted @ 2022-02-10 01:28 iiuu也一样 阅读(35) 评论(0) 推荐(0) 编辑
摘要: p81 异常的分类 try和throw ,throws import java.io.*; public class Teat1 { public static void main(String[] args){ TestEat T = new TestEat(); try{ System.out. 阅读全文
posted @ 2022-02-09 17:24 iiuu也一样 阅读(27) 评论(0) 推荐(0) 编辑
摘要: p43 Point案例 p 43 定义一个“点”(Point)类用来表示三 维空间中的点(有三个坐标)。要求如 下: 1.可以生成具有特定坐标的点对象。 2.提供可以设置三个坐标的方法。 3. 提供可以计算该“点"距原点距离平 方的方法。 4.编写程序验证上述三条。 public class tes 阅读全文
posted @ 2022-02-03 03:39 iiuu也一样 阅读(26) 评论(0) 推荐(0) 编辑
摘要: import java.util.ArrayList; import java.util.List; public class ArrayListTest { public static void main(String[]args){ //实例化 ArrayList 容器 List<String> 阅读全文
posted @ 2022-01-18 23:30 iiuu也一样 阅读(29) 评论(0) 推荐(0) 编辑