摘要: package com.oop;import com.oop.demo03.Pet;public class Application { public static void main(String[] args) { /* 1. 类与对象 类是一个模板:抽象,对象是一个具体的实例 2. 方法 定义 阅读全文
posted @ 2021-06-10 23:23 Leoyuan 阅读(46) 评论(0) 推荐(0) 编辑
摘要: package com.oop.demo03;public class Pet { public String name; public int age; //无构造参数 public void shout(){ System.out.println("叫了一声"); }}/* public sta 阅读全文
posted @ 2021-06-10 22:31 Leoyuan 阅读(33) 评论(0) 推荐(0) 编辑
摘要: package com.oop.demo02;//java-->classpublic class Person { //一个类即使什么都不写,它也会存在一个方法 //显示的定义构造器 String name; int age; //实例化初始化 //1. 使用new关键字,本质在调用构造器 //2 阅读全文
posted @ 2021-06-10 21:48 Leoyuan 阅读(42) 评论(0) 推荐(0) 编辑
摘要: package com.oop.demo02;//一个项目应该只有一个main方法public class Application { public static void main(String[] args) { //类:抽象的,实例化 //类实例化后会返回一个自己的对象! //student对 阅读全文
posted @ 2021-06-10 19:52 Leoyuan 阅读(39) 评论(0) 推荐(0) 编辑
摘要: package com.oop.demo01;public class Demo02 { public static void main(String[] args) { //实例化这个类 new //对象类型 对象名 = 对象值; Student student = new Student(); 阅读全文
posted @ 2021-06-10 17:50 Leoyuan 阅读(44) 评论(0) 推荐(0) 编辑
摘要: package com.oop.demo01;import java.io.IOException;//Demo01 类public class Demo01 { //main 方法 public static void main(String[] args) { } /* 修饰符 返回值类型 方法 阅读全文
posted @ 2021-06-10 17:17 Leoyuan 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2021-06-10 09:03 Leoyuan 阅读(24) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.array;public class ArrayDemo08 { public static void main(String[] args) { //1.创建一个二维数组 11* 11 0:没有棋子 1:黑棋 2:白棋 int[][] array1 = new in 阅读全文
posted @ 2021-06-10 08:48 Leoyuan 阅读(49) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.array;import java.util.Arrays;//冒泡排序//1. 比较数组中,两个相邻的元素,如果第一个数比第二个数大,我们就交换他们的位置//2. 每一次比较,都会产生一个最大,或者最小的数子;//3. 下一轮则可以少一次排序!//4. 依次循环,直 阅读全文
posted @ 2021-06-10 07:37 Leoyuan 阅读(54) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.array;import java.util.Arrays;public class ArrayDemo06 { public static void main(String[] args) { int [] a = {1,2,3,4,9090,31231,543,2 阅读全文
posted @ 2021-06-10 07:08 Leoyuan 阅读(44) 评论(0) 推荐(0) 编辑
摘要: package com.Leo.array;public class ArrayDemo05 { public static void main(String[] args) { //[4][2] /* 1,2 array[0] 2,3 array[1] 3,4 array[2] 4,5 array 阅读全文
posted @ 2021-06-10 06:43 Leoyuan 阅读(37) 评论(0) 推荐(0) 编辑