Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
JHZZ authored and JHZZ committed Nov 10, 2021
0 parents commit a199891
Show file tree
Hide file tree
Showing 96 changed files with 4,300 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Project exclude paths
/out/
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions .idea/uiDesigner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added 1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added 2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions JavaProjects.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="JUnit4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.13.1/junit-4.13.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>
21 changes: 21 additions & 0 deletions MY/MY.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="JUnit4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.13.1/junit-4.13.1.jar!/" />
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>
41 changes: 41 additions & 0 deletions MY/src/com/mjz/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.mjz;

import org.junit.Test;

/**
* @PACKAGE_NAME: com.mjz
* @author: JHZZ
* @date: 2021/11/4 23:24
* @PROJECT_NAME: JavaProjects
*/
public class Main {
public static void main(String[] args) {

MyLinkList mll = new MyLinkList();
for (int i = 1; i <= 10 ; i++) {
mll.addLast(i);
}
mll.print();
mll.deleteFirst();
mll.print();
mll.addFirst(4);
mll.print();
mll.deleteLast();
mll.deleteFirst();
mll.print();
System.out.println(test());
}

public static int test(){
try {
int n=10;
int i = n / 0;
return 10;
}catch(Exception e){
System.out.println(e.getStackTrace());
}finally {
System.out.println("finally");
return 20;
}
}
}
70 changes: 70 additions & 0 deletions MY/src/com/mjz/MyArrays.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
package com.mjz;

/**
* @PACKAGE_NAME: com.mjz
* @author: JHZZ
* @date: 2021/11/4 23:13
* @PROJECT_NAME: JavaProjects
*/
public class MyArrays {
private int capacity = 10;
private int length = 0;
private int[] arr;

public MyArrays() {
arr = new int[10];
}

public MyArrays(int capacity) {
this.capacity = capacity;
arr = new int[capacity];
}

public MyArrays(int[] arr) {
this.arr = arr;
}

public int get(int index){
return arr[index];
}
public int getLength() {
return length;
}

public int getCapacity() {
return capacity;
}

public void insert(int val) {
if (capacity == length){
//扩容操作
System.out.println("扩容操作");
int[] newarr=new int[arr.length*2];
newarr = arr.clone();
arr=newarr;

}else{
arr[length++] = val;
}
}
public int remove(int index) {
if (index >= capacity && index < 0){
return -1;
}else if(index >= length){
return -1;
}
for (int i = index; i <length ; i++) {
arr[i] = arr[i+1];
}

length--;
return arr[index];
}
public void print(){
System.out.print("[");
for (int i = 0; i < length; i++) {
System.out.print(arr[i]+" ");
}
System.out.println("]");
}
}
Loading

0 comments on commit a199891

Please sign in to comment.