随笔分类 - java
摘要:package com.test; public class test_3 { public static void main(String[] args) { System.out.println(); dog a =new dog(); a.setName("test"); a.eat(); a
阅读全文
摘要:package com.test;//封装 public class test_2 { public static void main(String[] args) { animal a = new animal(); a.setAge(18); a.setName("zhangsan"); a.t
阅读全文
摘要:/* //创建对象的格式:类名对象名= new_ 类名();Student s = new Student() ; class Demo1_ Student {public static void main (String[] args)//创建对象的格式:类名对象名= new_ 类名();//对象
阅读全文
摘要:一. 二维数组遍历 package test_1; public class test_7 { public static void main(String[] args) { int[][] arr = {{1,2,3},{5,6},{12,13,14}}; for(int i=0; i< arr
阅读全文
摘要:package test_1;//取反public class test_4 { public static void main(String[] args) { int[] arr = {11,22,33,44,55}; reverseArray(arr); //调用取反方法 print(arr)
阅读全文
摘要:int[] arr= new int[5]; 数据类型 [] 数组名 = new 数据类型【数组长度】;左边: int 数据类型[ ] :代表的数组,几个中括号代表几维数组arr: 合法的标识符右边:new: 创建一个新的实体或对象int:数据类型[ ]:代表数组5:代表数组的长度 package
阅读全文
摘要:package test_1; public class test_2 { public static void main(String[] args) { double[] myList = {1.9, 2.9, 3.4, 3.5}; for(int i=0;i < myList.length;i
阅读全文

浙公网安备 33010602011771号