摘要: package Demo.oop.APP; //一个项目通常只用一个启动器,也就是只有一个main方法 public class Application { public static void main(String[] args) { //类:抽象的需要实例化 //类实例化后会返回一个自己的对象 阅读全文
posted @ 2022-05-17 19:10 回忆也交给时间 阅读(44) 评论(0) 推荐(0)
摘要: package Demo.oop.APP;public class demo02 { /** * 类与对象小结 * 1.类与对象 * 类是一个模板,抽象,而对象是一个实例 * 2.方法:定义方法,可以以利用直接调用和,new关键字来调用 * 3.对应的引用 * 引用类型:基本类型 * 对象是通过引用 阅读全文
posted @ 2022-05-17 13:59 回忆也交给时间 阅读(30) 评论(0) 推荐(0)
摘要: package Demo.oop.APP; public class Pet { //public公用的,都可以调用 public String name; public int age; //无参构造 public void shout(){ System.out.println("叫了一声"); 阅读全文
posted @ 2022-05-17 13:28 回忆也交给时间 阅读(25) 评论(0) 推荐(0)
摘要: package Demo.oop.APP; //一个项目通常只用一个启动器,也就是只有一个main方法 public class Application { public static void main(String[] args) { //类:抽象的需要实例化 //类实例化后会返回一个自己的对象 阅读全文
posted @ 2022-05-16 23:05 回忆也交给时间 阅读(22) 评论(0) 推荐(0)
摘要: package Demo.oop; public class demo01 { public static void main(String[] args) { student.say();//静态方法 student student=new student();//非静态方法,当使用new方法时, 阅读全文
posted @ 2022-05-16 22:38 回忆也交给时间 阅读(33) 评论(0) 推荐(0)
摘要: package Demo.oop; public class demo01 { public static void main(String[] args) { student.say();//静态方法 student student=new student();//非静态方法,当使用new方法时, 阅读全文
posted @ 2022-05-16 22:15 回忆也交给时间 阅读(26) 评论(0) 推荐(0)
摘要: package array; public class demo06 { public static void main(String[] args) { //创建一个二维数组 11*11 int[][] array1 = new int[11][11]; //存放数据(稀疏数组的非零数据) arr 阅读全文
posted @ 2022-05-16 15:14 回忆也交给时间 阅读(15) 评论(0) 推荐(0)
摘要: package array; import java.util.Arrays; public class demo05 { public static void main(String[] args) { int[] a= {9,2,8,4,3,6}; int[] b=sort(a); System 阅读全文
posted @ 2022-05-15 23:05 回忆也交给时间 阅读(18) 评论(0) 推荐(0)
摘要: package array; import java.util.Arrays; public class demo04 { public static void main(String[] args) { int[] a = {1,2,3,456,74,89,25}; // toString打印或遍 阅读全文
posted @ 2022-05-13 22:24 回忆也交给时间 阅读(17) 评论(0) 推荐(0)
摘要: package array; public class demo03 { public static void main(String[] args) { int[] array1={1,2,3,4,5}; //JDK1.5,没有下标 //for增强//1.for-each for (int i : 阅读全文
posted @ 2022-05-12 15:36 回忆也交给时间 阅读(23) 评论(0) 推荐(0)