摘要:
instanceof关键字和向上向下转型 public class Computer {//电脑 public static void main(String[] args) { Pad pad = new Pad(); HuaWeiPad huaWeiPad = new HuaWeiPad(); 阅读全文
摘要:
直接选择排序 package com.ydlclass; public class Test { public static void main(String[] args) { int[] a = {14,8,74,32}; int index;//下标 for (int i = 1; i < a 阅读全文
摘要:
冒泡排序 package com.ydlclass; public class Test { public static void main(String[] args) { int[] a = {14,8,74,32}; for (int i = 1; i < a.length ; i++) {/ 阅读全文
摘要:
二维数组输出“春眠” package com.ydlclass; public class Test { public static void main(String[] args) { char [][] cm = {{'春','眠','不','绝','晓',','},{'处','处','闻',' 阅读全文
摘要:
超级数组 package com.ydlclass; /** * 超级数组 */ public class SuperArray { int [] elements; int currentIndex = -1; public SuperArray(){ this(10); } public Sup 阅读全文
摘要:
构造器、this关键字、setter和getter 构造器 我们一直在学习怎么封装class,一个class封装好之后的目的一般是创建实例对象,我们其实已经做过了。 Dog dog = new Dog(); new 一个对象的时候到底发生了什么事情呢? java在new一个对象的时候,会先查看对象所 阅读全文