摘要:
什么是程序:程序就是为了模拟现实世界,解决现实问题而使用计算机语言编写的指令集合 什么是对象:面向对象思想 一切客观的事物就是对象,万物皆对象 任何对象,一定具有自己的特征和行为:特征:称为属性,一般为名词,代表对象有什么。行为:称为方法,一般为动词,代表对象能做什么 分析一个对象都有什么(属性)
阅读全文
posted @ 2022-05-14 23:43
Tsunami黄嵩粟
阅读(71)
推荐(0)
摘要:
先看样式 var _t = this; var setting = { view: { fontCss: { color: "#5E5F61" }, showIcon: true, showLine: false }, data: { simpleData: { enable: true } },
阅读全文
posted @ 2022-05-06 17:19
Tsunami黄嵩粟
阅读(671)
推荐(0)
摘要:
pubilc class Test { pubilc static void main(String[] args){ int rows= 5; int[][] yh = new int[rows][]; //创建多个不同长度的二维数组 for(int i = 0 ; i < rows;i++){
阅读全文
posted @ 2022-05-03 13:50
Tsunami黄嵩粟
阅读(53)
推荐(0)
摘要:
概念:一维数组中的一维数组;数组中的元素,还是数组; pubilc class Test{ pubilc static void main(String[] args){ int[][] nums = new int[3][5]; nums[0][0] = 10;//第一行。第一列 nums[0][
阅读全文
posted @ 2022-05-03 12:57
Tsunami黄嵩粟
阅读(29)
推荐(0)
摘要:
冒泡排序:相邻的二个值比较大小,互换位置 选择排序:固定值与其他值依次比较大小,互换位置 JDK排序:java.util.Arrays.sort(数组名)//JDk提供升序 pubilc class Test{ pubilc static void main(String[],args){ int[
阅读全文
posted @ 2022-05-02 20:45
Tsunami黄嵩粟
阅读(45)
推荐(0)
摘要:
概念:可接收多个同类型实参,个数不限,使用方式与数组相同 语法:数据类型...形参名//必须定义在形参列表的最后,且只能有一个 public class Test{ pubilc static void main(String[] args){ int[] numbrs = {1,2,3,4,5,6
阅读全文
posted @ 2022-05-02 18:51
Tsunami黄嵩粟
阅读(38)
推荐(0)
摘要:
pubilc class TestParams{ public static void main(String[] args){ int[] nums = new int()[11,22,244,635,3542] print(nums ) } //引用数据类型。赋值也好,传参也好,操作的都是地址
阅读全文
posted @ 2022-04-23 18:34
Tsunami黄嵩粟
阅读(50)
推荐(0)
摘要:
数组作为引用类型之一,其变量中存储的是数组的地址 完成元素复制后,需将新数组地址,赋值给原变量进行替换 //替换功能(原位置的值,替换为新值) pubilc static void replace(int postion ,int value){ nums[postion] = value; } p
阅读全文
posted @ 2022-04-17 16:19
Tsunami黄嵩粟
阅读(107)
推荐(0)
摘要:
创建数组时,必须显示指定长度,并在创建之后不可更改长度 扩容的思路: 创建大于原数组长度的新数组 将原数组中的元素依次复制到新数组中 复制方式 循环将原数组中所有元素逐一赋值给新数组 pubilc class Test{ public static void main(String[] args){
阅读全文
posted @ 2022-04-16 19:34
Tsunami黄嵩粟
阅读(116)
推荐(0)
摘要:
声明并分配空间 数组类型[] 数组名= new 数据类型[长度] public class TestDemo{ pubilc static void main(String[] args){ String[] names = new String[4] System.outprintln(names
阅读全文
posted @ 2022-04-16 18:40
Tsunami黄嵩粟
阅读(43)
推荐(0)