摘要: 构造器 package com.andy.base.oop.demo01.demo03; public class Pet { public String name ;//null public int age ; //null //无参构造 public void shout(){ System. 阅读全文
posted @ 2023-02-27 18:15 努力学习的J1an-JIan 阅读(17) 评论(0) 推荐(0)
摘要: 面向对象 package com.andy.base.oop.demo01; public class Demo01 { //main方法 public static void main(String[] args) { } /* 修饰符 返回类型 方法名(...){ //方法体 return 返回 阅读全文
posted @ 2023-02-27 18:14 努力学习的J1an-JIan 阅读(5) 评论(0) 推荐(0)
摘要: 稀疏数组 package com.andy.base.Andy.operator.array; import java.util.Arrays; public class ArrayDemo08 { public static void main(String[] args) { //创建一个二维数 阅读全文
posted @ 2023-02-27 18:14 努力学习的J1an-JIan 阅读(15) 评论(0) 推荐(0)
摘要: 冒泡排序 package com.andy.base.Andy.operator.array; import java.lang.reflect.Array; import java.util.Arrays; //冒泡排序 //1.比较数组中,两个相邻的元素,如果第一个数比第二个数大,我们就交换它们 阅读全文
posted @ 2023-02-26 19:19 努力学习的J1an-JIan 阅读(16) 评论(0) 推荐(0)
摘要: 方法:数组 package com.andy.base.Andy.operator.array; public class ArrayDemo01 { public static void main(String[] args) { //变量的类型 变量的名字 = 变量的值; //数组类型 int[ 阅读全文
posted @ 2023-02-26 19:19 努力学习的J1an-JIan 阅读(15) 评论(0) 推荐(0)
摘要: 方法:递归讲解 package com.andy.base.Andy.operator.method; public class Demo05 { public static void main(String[] args) { //递归头:什么时候不调用自身方法,如果没有头,将陷入死循环 //递归 阅读全文
posted @ 2023-02-26 19:18 努力学习的J1an-JIan 阅读(16) 评论(0) 推荐(0)
摘要: Java方法-什么是方法 package com.andy.base.Andy.operator.method; public class Demo01 { //main方法 public static void main(String[] args) { //int sum = add(1, 2) 阅读全文
posted @ 2023-02-26 19:18 努力学习的J1an-JIan 阅读(28) 评论(0) 推荐(0)
摘要: Break-Continue package com.andy.base.Andy.operator.structure;​public class BreakDemo { public static void main(String[] args) { int i = 0; while (i<10 阅读全文
posted @ 2023-02-26 19:17 努力学习的J1an-JIan 阅读(14) 评论(0) 推荐(0)
摘要: For package com.andy.base.Andy.operator.structure; public class ForDemo01 { public static void main(String[] args) { int a = 1; //初始条件 while (a<=100){ 阅读全文
posted @ 2023-02-26 19:16 努力学习的J1an-JIan 阅读(30) 评论(0) 推荐(0)
摘要: While-Do.While package com.andy.base.Andy.operator.structure; public class DoWhileDemo01 { public static void main(String[] args) { int i = 0; int sum 阅读全文
posted @ 2023-02-26 19:15 努力学习的J1an-JIan 阅读(17) 评论(0) 推荐(0)