摘要: //创建一个Person类 class Person{ String name; int age; boolean isMale; } //创建一个测试类PersonTest class PersonTest{ main(){ //new 一个Person类对象:p1 //,即在栈中创建索引值0x1 阅读全文
posted @ 2020-02-18 22:02 我的二天 阅读(371) 评论(0) 推荐(0) 编辑
摘要: /* * Arrays数组工具的基本使用 */import java.util.Arrays;public class Day02_03 { public static void main(String[] args) { int [] num=new int [] {16,23,65,28,19, 阅读全文
posted @ 2020-02-18 20:14 我的二天 阅读(225) 评论(0) 推荐(0) 编辑
摘要: main{ //初始化一个数组 int [] num=new int [] {16,23,65,28,19,78,69}; System.out.println("该数组的长度: "+num.length); System.out.println("***********"); //冒泡排序该数组: 阅读全文
posted @ 2020-02-18 19:37 我的二天 阅读(78) 评论(0) 推荐(0) 编辑
摘要: package study;public class Day02_01 { public static void main(String []args){ int[][] yHui=new int[10][]; for(int i=0; i<yHui.length;i++){ yHui[i]=new 阅读全文
posted @ 2020-02-18 15:20 我的二天 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 数组:1.数组是引用数据类型 2.数组的元素是基本数据类型也可以是引用数据类型 3.数组元素在内存中是连续存储的 1.数组元素的调用 //静态初始化 int []nums =new int [] {1,2,3,4,5} //动态初始化 String[ ] foods= new String[5] / 阅读全文
posted @ 2020-02-18 14:14 我的二天 阅读(221) 评论(0) 推荐(0) 编辑