02 2021 档案

摘要:1 package com.oop; 2 3 import com.oop.demo6.Person; 4 import com.oop.demo6.Student; 5 6 public class Application { 7 8 public static void main(String[ 阅读全文
posted @ 2021-02-19 21:37 奔啵儿灞 阅读(102) 评论(0) 推荐(0)
摘要:1 重写:需要有继承关系,子类重写父类的方法! 2 1.方法名必须相同 3 2.参数列表列表必须相同 4 3.修饰符:范围可以扩大但不能缩小:public>Protected>Default>private 5 4.抛出的异常:范围,可以被缩小,但不能扩大; ClassNotFoundExcepti 阅读全文
posted @ 2021-02-17 21:35 奔啵儿灞 阅读(292) 评论(0) 推荐(0)
摘要:1 super注意点: 2 1. super调用父类的构造方法,必须在构造方法的第一个 3 2. super 必须只能出现在子类的方法或者构造方法中! 4 3.super和this不能同时调用构造方法! 5 Vs this: 6 代表的对象不同: 7 this:本身调用者这个对象 8 super:代 阅读全文
posted @ 2021-02-17 20:42 奔啵儿灞 阅读(181) 评论(0) 推荐(0)
摘要:1 package com.oop.demo5; 2 //在Java中, 所有的类,都默认直接或者间接继承object 3 //Person人: 父类 ctrl+H 展开继承关系树 4 public class Person { 5 //public 6 //protected 7 //defaul 阅读全文
posted @ 2021-02-17 16:50 奔啵儿灞 阅读(72) 评论(0) 推荐(0)
摘要:1 package com.oop.demo4; 2 //类 private: 私有 3 public class Student { 4 //属性私有 5 private String name; //名字 6 private int id; //学号 7 private char sex; // 阅读全文
posted @ 2021-02-17 16:29 奔啵儿灞 阅读(77) 评论(0) 推荐(0)
摘要:1 /* 2 1.类与对象 3 类是一个模板:抽象,对象是一个具体的实例 4 5 2.方法 6 定义、调用! 7 8 3.对应的引用 9 引用类型:基本类型 (8) 10 对象是通过引用来操作的:栈 >堆 11 12 4.属性:字段Field成员变量 13 默认初始化: 14 数字: 0 0.0 1 阅读全文
posted @ 2021-02-17 15:58 奔啵儿灞 阅读(67) 评论(0) 推荐(0)
摘要:1 package com.oop.demo3; 2 3 public class Pet { 4 public String name; 5 public int age; 6 //无参构造,默认有的 7 public void shout(){ 8 System.out.println("叫了一 阅读全文
posted @ 2021-02-17 15:47 奔啵儿灞 阅读(36) 评论(0) 推荐(0)
摘要:1 package com.oop.demo2; 2 //Java-->class 3 public class Person { 4 //一个类即使什么都不写,它也会存在一个方法 5 //显示的定义构造器 6 String name; 7 int age; 8 //无参构造器 9 //实例化初始值 阅读全文
posted @ 2021-02-17 14:36 奔啵儿灞 阅读(58) 评论(0) 推荐(0)
摘要:1 package com.oop.demo2; 2 //一个项目应该只存一个main方法 3 public class Application { 4 public static void main(String[] args) { 5 //类:抽象的,需要实例化 6 //类实例化后会返回一个自己 阅读全文
posted @ 2021-02-17 11:32 奔啵儿灞 阅读(71) 评论(0) 推荐(0)
摘要:1 package com.oop.demo; 2 3 import java.io.IOException; 4 5 //Demo1 类 6 public class Demo1 { 7 //main 方法 8 public static void main(String[] args) { 9 阅读全文
posted @ 2021-02-17 11:22 奔啵儿灞 阅读(70) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-02-17 11:12 奔啵儿灞 阅读(44) 评论(0) 推荐(0)
摘要:1 package com.lin.array; 2 3 public class ArrayDemo8 { 4 public static void main(String[] args) { 5 //1.创建一个二维数组11*11 0:没有棋子 1:黑棋 2:白棋 6 int[][] array 阅读全文
posted @ 2021-02-17 00:54 奔啵儿灞 阅读(53) 评论(0) 推荐(0)
摘要:1 package com.lin.array; 2 //冒泡排序 3 //1.比较数组中,两个相邻的元素,如果第一个数比第 二: 个教大,我们就交换他们的位置 4 //2.每一次比较,都会产生出一一个最大, 或者最小的数字; 5 //3.下一 轮则可以少-次排序! 6 //4.依次循环,直到结束! 阅读全文
posted @ 2021-02-16 23:48 奔啵儿灞 阅读(70) 评论(0) 推荐(0)
摘要:1 package com.lin.array; 2 3 import java.util.Arrays; 4 5 public class ArrayDemo6 { 6 public static void main(String[] args) { 7 int[] a={1,2,3,4,9090 阅读全文
posted @ 2021-02-16 19:51 奔啵儿灞 阅读(37) 评论(0) 推荐(0)
摘要:1 package com.lin.array; 2 3 public class ArrayDemo5 { 4 public static void main(String[] args) { 5 /* 6 array[0] 1,2 7 array[1] 2,3 8 array[2] 3,4 9 阅读全文
posted @ 2021-02-16 17:04 奔啵儿灞 阅读(59) 评论(0) 推荐(0)
摘要:1 package com.lin.array; 2 3 public class ArrayDemo4 { 4 public static void main(String[] args) { 5 int[] arrays={1,2,3,4,5}; 6 7 //jdk1.5,没有下标 8 // f 阅读全文
posted @ 2021-02-16 16:46 奔啵儿灞 阅读(55) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-02-16 16:19 奔啵儿灞 阅读(33) 评论(0) 推荐(0)
摘要:1 package com.lin.array; 2 3 public class ArrayDemo1 { 4 //变量的类型 变量的名字=变量的值 5 //数组类型 6 public static void main(String[] args) { 7 int[] nums;//1.声明一个数 阅读全文
posted @ 2021-02-15 21:53 奔啵儿灞 阅读(72) 评论(0) 推荐(0)
摘要:1 package com.lin.array; 2 3 public class ArrayDemo1 { 4 //变量的类型 变量的名字=变量的值 5 //数组类型 6 public static void main(String[] args) { 7 int[] nums;//1.声明一个数 阅读全文
posted @ 2021-02-15 21:52 奔啵儿灞 阅读(63) 评论(0) 推荐(0)
摘要:1 package com.lin.method; 2 3 import java.util.Scanner; 4 5 public class Demo6 { 6 public static void main(String[] args) { 7 Scanner scanner = new Sc 阅读全文
posted @ 2021-02-14 15:27 奔啵儿灞 阅读(120) 评论(0) 推荐(0)
摘要:1 package com.lin.method; 2 //能不用递归就不用递归,可用其他方法代替 3 //基数比较小的情况可以使用 4 public class Demo5 { 5 public static void main(String[] args) { 6 //5! 5*4*3*2*1 阅读全文
posted @ 2021-02-14 14:53 奔啵儿灞 阅读(25) 评论(0) 推荐(0)
摘要:1 package com.lin.method; 2 3 public class Demo4 { 4 public static void main(String[] args) { 5 //调用可变参数的方法 6 printMax(1,1.1,2,3); 7 printMax(new doub 阅读全文
posted @ 2021-02-14 13:47 奔啵儿灞 阅读(33) 评论(0) 推荐(0)
摘要:1 package com.lin.method; 2 3 public class Demo3 { 4 public static void main(String[] args) { 5 //args.length 数组长度 6 for (int i = 0; i < args.length ; 阅读全文
posted @ 2021-02-13 18:43 奔啵儿灞 阅读(81) 评论(0) 推荐(0)
摘要:1 package com.lin.method; 2 3 public class Demo2 { 4 public static void main(String[] args) { 5 //一个方法的签名只与参数和方法名有关,方法名一样,参数名不一致则为重载,与返回值无关 6 int max 阅读全文
posted @ 2021-02-13 17:00 奔啵儿灞 阅读(60) 评论(0) 推荐(0)
摘要:1 package com.lin.method; 2 3 public class Demo1 { 4 //main方法 5 public static void main(String[] args) { 6 //实际参数:实际调用传递给他的参数 7 int sum = add(1, 2); 8 阅读全文
posted @ 2021-02-13 16:05 奔啵儿灞 阅读(51) 评论(0) 推荐(0)
摘要:1 package com.lin.method; 2 3 public class Demo1 { 4 //main方法 5 public static void main(String[] args) { 6 int sum = add(1, 2); 7 System.out.println(s 阅读全文
posted @ 2021-02-13 15:51 奔啵儿灞 阅读(45) 评论(0) 推荐(0)
摘要:1 package com.lin.struct; 2 3 public class BreakDemo { 4 public static void main(String[] args) { 5 int i=0; 6 while (i<100){ 7 i++; 8 System.out.prin 阅读全文
posted @ 2021-02-13 15:29 奔啵儿灞 阅读(95) 评论(0) 推荐(0)
摘要:1 package com.lin.struct; 2 //主要用于数组和集合 3 public class ForDemo5 { 4 public static void main(String[] args) { 5 int[] numbers={10,20,30,40,50};//定义了一个数 阅读全文
posted @ 2021-02-13 12:59 奔啵儿灞 阅读(52) 评论(0) 推荐(0)
摘要:1 package com.lin.struct; 2 3 public class ForDemo1 { 4 public static void main(String[] args) { 5 int a=1;//初始化条件 6 while (a<=100){//条件判断 7 System.ou 阅读全文
posted @ 2021-02-12 22:41 奔啵儿灞 阅读(74) 评论(0) 推荐(0)
摘要:1 package com.lin.struct; 2 3 public class DoWhileDemo1 { 4 public static void main(String[] args) { 5 int i =0 ; 6 int sum =0 ; 7 //do...While的话是先执行一 阅读全文
posted @ 2021-02-12 21:44 奔啵儿灞 阅读(55) 评论(0) 推荐(0)
摘要:1 package com.lin.struct; 2 3 public class WhileDemo1 { 4 public static void main(String[] args) { 5 //输出1~100 6 int i = 0; 7 while (i<100){ 8 i++; 9 阅读全文
posted @ 2021-02-12 21:43 奔啵儿灞 阅读(49) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-02-11 16:26 奔啵儿灞 阅读(21) 评论(0) 推荐(0)
摘要:1 package com.lin.struct; 2 3 public class SwitchDemo1 { 4 public static void main(String[] args) { 5 //case 穿透 //switch 匹配一个具体的值 6 char grade = 'C'; 阅读全文
posted @ 2021-02-11 15:43 奔啵儿灞 阅读(89) 评论(0) 推荐(0)
摘要:1 package com.lin.struct; 2 3 import java.util.Scanner; 4 5 public class IfDemo1 { 6 public static void main(String[] args) { 7 Scanner scanner = new 阅读全文
posted @ 2021-02-11 15:16 奔啵儿灞 阅读(49) 评论(0) 推荐(0)
摘要:package com.lin.struct; public class ShunXuDemo { public static void main(String[] args) { System.out.println("hello1"); System.out.println("hello2"); 阅读全文
posted @ 2021-02-10 23:17 奔啵儿灞 阅读(44) 评论(0) 推荐(0)
摘要:1 package com.lin.scanner; 2 3 import java.util.Scanner; 4 5 public class Demo1 { 6 public static void main(String[] args) { 7 //创建一个扫描器对象,用于接受键盘数据 8 阅读全文
posted @ 2021-02-07 23:37 奔啵儿灞 阅读(69) 评论(0) 推荐(0)
摘要:1 package com.lin.base; 2 3 /** 4 * @author Lin 5 * @version 1.0 6 * @since 11 7 */ 8 public class Doc { 9 String name; 10 11 /** 12 * 13 * @param nam 阅读全文
posted @ 2021-02-05 21:49 奔啵儿灞 阅读(115) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-02-04 17:36 奔啵儿灞 阅读(23) 评论(0) 推荐(0)
摘要:一元运算符 1 package operation; 2 //一元运算符:++ -- 自增 自减 3 public class Demo3 { 4 public static void main(String[] args) { 5 6 //++在前先自增再赋值,++在后先赋值再自增 7 int a 阅读全文
posted @ 2021-02-04 16:45 奔啵儿灞 阅读(38) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-02-03 21:46 奔啵儿灞 阅读(43) 评论(0) 推荐(0)
摘要:1 package operation; 2 3 public class Demo1 { 4 public static void main(String[] args) { 5 //二元运算符 6 //Ctrl+D :复制当前行到下一行 7 int a=10; 8 int b=20; 9 int 阅读全文
posted @ 2021-02-03 21:44 奔啵儿灞 阅读(45) 评论(0) 推荐(0)
摘要:1 package base; 2 3 public class Demo3 { 4 //类变量 static 5 //修饰符顺序不讲究 6 static double salary =2500; 7 8 // 属性:变量 9 10 // 实例变量:从属于对象;如果不自行初始化,这个类型的默认值 0 阅读全文
posted @ 2021-02-03 21:42 奔啵儿灞 阅读(51) 评论(0) 推荐(0)
摘要:1 public class Demo2 { 2 public static void main(String[] args) { 3 int i=128; 4 byte b=(byte)i;//内存溢出 5 // 低 高 6 // byte,short,char->int->long->float 阅读全文
posted @ 2021-02-02 23:10 奔啵儿灞 阅读(51) 评论(0) 推荐(0)
摘要:1 public class Demo1 { 2 public static void main(String[] args) { 3 // 整数拓展: 进制 二进制0b 十进制 八进制0 十六进制0x 4 int i=10; 5 int i2=010;//八进制0 6 int i3=0x10;// 阅读全文
posted @ 2021-02-02 22:39 奔啵儿灞 阅读(54) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-02-02 20:05 奔啵儿灞 阅读(43) 评论(0) 推荐(0)
摘要:Description of Java Conceptual Diagram Java概念图的描述 关于 JDK、JRE、JVM 之间是什么关系,在 Java 平台标准中已经明确定义了。也就是上面的英文介绍部分。 Oracle 有两个 Java 平台标准的产品,Java SE 开发工具包(JDK) 阅读全文
posted @ 2021-02-02 11:22 奔啵儿灞 阅读(746) 评论(0) 推荐(0)
摘要:path的配置: 打开Dos命令窗口,默认的访问目录是C:\Users\Administrator,在此目录下并没有安装JDK,而在着里可以直接运行Javac.exe命令,这是因为在path(注意:path环境变量是属于操作系统的)的配置中有多条以;(分号)区分的路径,而JDK的路径就在其中,当系统 阅读全文
posted @ 2021-02-01 21:58 奔啵儿灞 阅读(61) 评论(0) 推荐(0)
摘要:编译时执行此命令:javac -encoding utf-8 HelloWorld.java 阅读全文
posted @ 2021-02-01 21:45 奔啵儿灞 阅读(386) 评论(0) 推荐(0)