summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaidong Ji2018-07-28 11:54:49 -0500
committerHaidong Ji2018-07-28 11:54:49 -0500
commitd9978c0c13659c82ff288035474e485f6ee44c14 (patch)
treeb4f14bcb428c9148d758b95e44e83b59f742db89
Initial commit
-rw-r--r--AlgoDesignAndTechniqueEdxJava/.classpath12
-rw-r--r--AlgoDesignAndTechniqueEdxJava/.gitignore1
-rw-r--r--AlgoDesignAndTechniqueEdxJava/.project17
-rw-r--r--AlgoDesignAndTechniqueEdxJava/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--AlgoDesignAndTechniqueEdxJava/sources/APlusB.java18
-rw-r--r--AlgoDesignAndTechniqueEdxJava/tests/APlusBTest.java13
6 files changed, 73 insertions, 0 deletions
diff --git a/AlgoDesignAndTechniqueEdxJava/.classpath b/AlgoDesignAndTechniqueEdxJava/.classpath
new file mode 100644
index 0000000..2e7b73a
--- /dev/null
+++ b/AlgoDesignAndTechniqueEdxJava/.classpath
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-9">
+ <attributes>
+ <attribute name="module" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="src" path="sources"/>
+ <classpathentry kind="src" path="tests"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/AlgoDesignAndTechniqueEdxJava/.gitignore b/AlgoDesignAndTechniqueEdxJava/.gitignore
new file mode 100644
index 0000000..ae3c172
--- /dev/null
+++ b/AlgoDesignAndTechniqueEdxJava/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/AlgoDesignAndTechniqueEdxJava/.project b/AlgoDesignAndTechniqueEdxJava/.project
new file mode 100644
index 0000000..52fd05e
--- /dev/null
+++ b/AlgoDesignAndTechniqueEdxJava/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>AlgoDesignAndTechniqueEdxJava</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/AlgoDesignAndTechniqueEdxJava/.settings/org.eclipse.jdt.core.prefs b/AlgoDesignAndTechniqueEdxJava/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..021167a
--- /dev/null
+++ b/AlgoDesignAndTechniqueEdxJava/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=9
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=9
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.release=enabled
+org.eclipse.jdt.core.compiler.source=9
diff --git a/AlgoDesignAndTechniqueEdxJava/sources/APlusB.java b/AlgoDesignAndTechniqueEdxJava/sources/APlusB.java
new file mode 100644
index 0000000..d0a384a
--- /dev/null
+++ b/AlgoDesignAndTechniqueEdxJava/sources/APlusB.java
@@ -0,0 +1,18 @@
+import java.util.Scanner;
+public class APlusB {
+
+ public static int add(int i, int j) {
+ return i + j;
+ }
+
+ public static void main(String[] args) {
+ Scanner s = new Scanner(System.in);
+
+ int a = s.nextInt();
+ int b = s.nextInt();
+
+ System.out.println(add(a,b));
+ s.close();
+ }
+
+}
diff --git a/AlgoDesignAndTechniqueEdxJava/tests/APlusBTest.java b/AlgoDesignAndTechniqueEdxJava/tests/APlusBTest.java
new file mode 100644
index 0000000..868f853
--- /dev/null
+++ b/AlgoDesignAndTechniqueEdxJava/tests/APlusBTest.java
@@ -0,0 +1,13 @@
+
+import static org.junit.jupiter.api.Assertions.*;
+
+import org.junit.jupiter.api.Test;
+
+class APlusBTest {
+
+ @Test
+ void test() {
+ assertEquals(5, APlusB.add(2,3));
+ }
+
+}