Skip to content

Commit a70c59f

Browse files
committed
add files
1 parent 7d58675 commit a70c59f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+986
-0
lines changed

algorithm/exercises/.classpath

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
5+
<classpathentry kind="src" path="/JDBCtest"/>
6+
<classpathentry kind="output" path="bin"/>
7+
</classpath>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=1.8
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11+
org.eclipse.jdt.core.compiler.source=1.8

algorithm/exercises/b.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
BBBBBBBBBB

algorithm/exercises/bin/a.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FUCK YOU
1.25 KB
Binary file not shown.
Binary file not shown.
614 Bytes
Binary file not shown.
972 Bytes
Binary file not shown.
1.19 KB
Binary file not shown.
1.42 KB
Binary file not shown.
969 Bytes
Binary file not shown.
1.82 KB
Binary file not shown.
3.12 KB
Binary file not shown.
661 Bytes
Binary file not shown.
665 Bytes
Binary file not shown.
1.45 KB
Binary file not shown.
310 Bytes
Binary file not shown.
1.41 KB
Binary file not shown.
1.27 KB
Binary file not shown.
597 Bytes
Binary file not shown.
1.17 KB
Binary file not shown.
1.21 KB
Binary file not shown.
688 Bytes
Binary file not shown.
7.16 KB
Binary file not shown.

algorithm/exercises/src/a.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FUCK YOU
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package exercises1;
2+
3+
public enum Color {
4+
RED("ºìÉ«"),BLUE("À¶É«");
5+
6+
private String c;
7+
8+
Color(String c)
9+
{
10+
this.c=c;
11+
}
12+
public void setColor(String c)
13+
{
14+
this.c=c;
15+
}
16+
public String getColor()
17+
{
18+
19+
return c;
20+
}
21+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package exercises1;
2+
3+
import javax.swing.plaf.synth.SynthSpinnerUI;
4+
5+
public class Consumer implements Runnable {
6+
7+
Product p;
8+
9+
Consumer(Product p) {
10+
this.p = p;
11+
System.out.println("make consumer");
12+
}
13+
14+
@Override
15+
16+
public void run() {
17+
while (true) {
18+
while (p.num > 0) {
19+
20+
System.out.println("buy product " + (p.num--) + " - 1");
21+
System.out.println("now product is " + p.num);
22+
23+
try {
24+
if (p.num == 0) {
25+
26+
System.out.println("notify seller");
27+
Thread.currentThread().yield();
28+
29+
}
30+
31+
} catch (Exception e) {
32+
// TODO ×Ô¶¯Éú³ÉµÄ catch ¿é
33+
e.printStackTrace();
34+
}
35+
36+
}
37+
38+
}
39+
}
40+
41+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package exercises1;
2+
3+
public class Fa {
4+
String name="father";
5+
6+
public void f()
7+
{
8+
System.out.println("fffff");}
9+
public void callName()
10+
{
11+
System.out.println(this.name);}
12+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package exercises1;
2+
3+
public class Father {
4+
5+
private static String baseName = "father";
6+
7+
8+
Father() {
9+
System.out.println("fa struct");
10+
callName();
11+
12+
System.out.println("endFather---------");
13+
}
14+
15+
static {
16+
baseName = "basefather";
17+
}
18+
19+
public void callName() {
20+
21+
System.out.println("fa callName");
22+
System.out.println("fbaseName " + baseName);
23+
}
24+
25+
public class Son extends Father
26+
27+
{
28+
private String baseName = "son";
29+
30+
public Son() {
31+
System.out.println("son struct");
32+
callName();
33+
System.out.println("endSon-----------");
34+
}
35+
36+
public void callName() {
37+
System.out.println("son callName");
38+
System.out.println("sonbaseName " + baseName);
39+
40+
}
41+
42+
}
43+
44+
public static void main(String[] args) {
45+
Father2 f = new Son2();
46+
f.callName();
47+
}
48+
49+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package exercises1;
2+
3+
import exercises1.Father.Son;
4+
5+
public class Father2 {
6+
7+
8+
private String baseName = "father2";
9+
private String fown="fown";
10+
11+
Father2() {
12+
13+
}
14+
static {
15+
showSname();
16+
}
17+
18+
private static String sName = "sName : father2";
19+
20+
21+
public static void showSname()
22+
{System.out.println("load static of father");
23+
System.out.println(sName);
24+
}
25+
26+
String q="q";
27+
public void show()
28+
{
29+
System.out.println("show");
30+
System.out.println("q : "+q);
31+
}
32+
public void callName() {
33+
34+
35+
System.out.println("fa2 callName");
36+
System.out.println("f2baseName " + baseName);
37+
}
38+
public static void main(String[] args) {
39+
40+
System.out.println("ssssssss");
41+
42+
System.out.println("------------------");
43+
Son2 s=new Son2();
44+
}
45+
46+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package exercises1;
2+
3+
import java.util.*;
4+
5+
public class Ite<T> implements Iterable<T> {
6+
7+
LinkedList<String> q = new LinkedList<String>();
8+
9+
public void init()
10+
11+
{
12+
q.add("a");
13+
q.add("b");
14+
System.out.println("after init size is "+q.size());
15+
}
16+
17+
public static void main(String[] args) {
18+
Ite i=new Ite();
19+
i.init();
20+
for(Object x:i)
21+
System.out.println(x);
22+
23+
}
24+
itor it = new itor();
25+
public class itor implements Iterator {
26+
27+
@Override
28+
public boolean hasNext() {
29+
System.out.println("hasnext");
30+
if(q.size()!=0)
31+
return true;
32+
return false;
33+
}
34+
35+
@Override
36+
public String next() {
37+
return "s";
38+
// return q.removeFirst();
39+
}
40+
41+
}
42+
43+
@Override
44+
public Iterator<T> iterator() {
45+
return it;
46+
}
47+
48+
}

0 commit comments

Comments
 (0)