![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数组
谭小布偶
这个作者很懒,什么都没留下…
展开
-
链表
链表class Node1{ public int val; public Node1 next; public Node1(int val){ this.val = val; }}public class MyLinkedList { public boolean find(Node1 head,int val){ if (head == null)return false; Node1 cur = head原创 2021-05-16 10:05:34 · 72 阅读 · 0 评论 -
顺序表
重点1.同一个类的对象使用不同的内存段,但静态成员共享相同的内存空间2.加粗样式原创 2021-05-16 10:03:55 · 54 阅读 · 0 评论 -
浅谈数据结构1
Collectionpublic static void main(String[] args) { Collection<String>collection = new ArrayList<>(); collection.add("hello");//增加元素 collection.add(" "); collection.add("world"); System.out.println(collec原创 2021-05-04 16:40:05 · 38 阅读 · 0 评论 -
String 的基础用法
创建Stringpublic class Solution{ public static void main(String[] args) { String str = "helloworld"; String str1 = "hello"; String str2 = "world"; String str3 = str1+str2; String str4 = str; System.out.pr原创 2021-05-03 22:29:16 · 75 阅读 · 0 评论 -
数组
数组练习1.null的使用public static void main(String[] args) { int[]arr = null; System.out.println(arr); System.out.println(arr[0]); }null的作用类似于C语言中的NULL(空指针)当我访问arr的地址时,会运行得到null而当我访问arr每个下标对应的数值会出现空指针异常2,数组转字符串 public static原创 2021-04-23 19:27:06 · 102 阅读 · 0 评论 -
数组的认识和使用
数组数组的初建数据类型[ ] 数组名称=new 数组类型[ ]{初始化数据}数据类型[ ] 数据名称 = {初始化数据} public static void main(String[] args) { int [] arr = new int[]{1,3,5}; int[] arr1 = {1,3,5}; System.out.println(Arrays.toString(arr)); System.out.println(A原创 2021-04-22 14:22:14 · 36 阅读 · 0 评论 -
(初识数组)2
数组数组调用public class March {public static void main(String[] args) {int[] array1 = new int[]{1,2,3,4,5,6,7};int[] num1 = copyArray(array1);int[] array2 = new int[7];int[] num2 = copyArray(array2);System.out.println(Arrays.toString(num2));//注意转换为字符串,否原创 2021-04-12 10:27:37 · 40 阅读 · 0 评论 -
(初识数组)
(初识数组)数组数组的基本形式{int[] arrray ={1,2,3,4,5};int[] array1 = new int[5];int[] array2 = new int[]{1,2,3,4,5};}数组的应用(1)可以通过Arrays.toString将数组转化为字符串。public static void main(String[] args) {int[] ant = new int[]{1, 2, 3, 4, 5};String newAnt = Arrays.to原创 2021-04-09 21:54:02 · 62 阅读 · 0 评论