JAVA语言程序设计答案和源码
JAVA语言程序设计答案和源码,只包含偶数题目,不包括技术题目,包括了基础和进阶的两个版本。
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 631 2009-10-15 14:06 java答案java答案书本上的例题程序A.class
文件 429 2009-10-15 14:06 java答案java答案书本上的例题程序AbstractGraph$Edge.class
文件 2849 2009-10-15 14:06 java答案java答案书本上的例题程序AbstractGraph$Tree.class
文件 8825 2009-10-15 14:06 java答案java答案书本上的例题程序AbstractGraph.class
文件 12435 2009-04-18 10:32 java答案java答案书本上的例题程序AbstractGraph.java
文件 944 2009-10-15 14:06 java答案java答案书本上的例题程序AbstractTree.class
文件 558 2007-05-13 20:44 java答案java答案书本上的例题程序AbstractTree.java
文件 869 2009-10-15 14:06 java答案java答案书本上的例题程序AccountWithoutSync$Account.class
文件 705 2009-10-15 14:06 java答案java答案书本上的例题程序AccountWithoutSync$AddAPennyTask.class
文件 1636 2009-10-15 14:06 java答案java答案书本上的例题程序AccountWithoutSync.class
文件 1239 2007-05-14 06:32 java答案java答案书本上的例题程序AccountWithoutSync.java
文件 1142 2009-10-15 14:06 java答案java答案书本上的例题程序AccountWithSyncUsingLock$Account.class
文件 645 2009-10-15 14:06 java答案java答案书本上的例题程序AccountWithSyncUsingLock$AddAPennyTask.class
文件 1593 2009-10-15 14:06 java答案java答案书本上的例题程序AccountWithSyncUsingLock.class
文件 1472 2007-05-14 06:32 java答案java答案书本上的例题程序AccountWithSyncUsingLock.java
文件 1770 2009-10-15 14:06 java答案java答案书本上的例题程序ActionInterfaceDemo$MyAction.class
文件 4144 2009-10-15 14:06 java答案java答案书本上的例题程序ActionInterfaceDemo.class
文件 3821 2007-05-14 13:32 java答案java答案书本上的例题程序ActionInterfaceDemo.java
文件 744 2009-10-15 14:06 java答案java答案书本上的例题程序AdapterDemo$1.class
文件 839 2009-10-15 14:06 java答案java答案书本上的例题程序AdapterDemo.class
文件 609 2007-05-13 09:22 java答案java答案书本上的例题程序AdapterDemo.java
文件 1413 2009-10-15 14:06 java答案java答案书本上的例题程序AdditionQuiz.class
文件 548 2007-10-05 22:09 java答案java答案书本上的例题程序AdditionQuiz.java
文件 1252 2009-10-15 14:06 java答案java答案书本上的例题程序Address.class
文件 0 2006-12-29 19:09 java答案java答案书本上的例题程序address.dat
文件 823 2007-05-13 08:13 java答案java答案书本上的例题程序Address.java
文件 636 2009-10-15 14:06 java答案java答案书本上的例题程序AddressBook$1.class
文件 924 2009-10-15 14:06 java答案java答案书本上的例题程序AddressBook$2.class
文件 1049 2009-10-15 14:06 java答案java答案书本上的例题程序AddressBook$3.class
文件 1063 2009-10-15 14:06 java答案java答案书本上的例题程序AddressBook$4.class
............此处省略3564个文件信息
import java.util.*;
public abstract class AbstractGraph implements Graph {
protected List vertices; // Store vertices
protected List> neighbors; // Adjacency lists
/** Construct a graph from edges and vertices stored in arrays */
protected AbstractGraph(int[][] edges V[] vertices) {
this.vertices = new ArrayList();
for (int i = 0; i < vertices.length; i++)
this.vertices.add(vertices[i]);
createAdjacencyLists(edges vertices.length);
}
/** Construct a graph from edges and vertices stored in List */
protected AbstractGraph(List edges List vertices) {
this.vertices = vertices;
createAdjacencyLists(edges vertices.size());
}
/** Construct a graph for integer vertices 0 1 2 and edge list */
protected AbstractGraph(List edges int numberOfVertices) {
vertices = new ArrayList(); // Create vertices
for (int i = 0; i < numberOfVertices; i++) {
vertices.add((V)(new Integer(i))); // vertices is {0 1 ...}
}
createAdjacencyLists(edges numberOfVertices);
}
/** Construct a graph from integer vertices 0 1 and edge array */
protected AbstractGraph(int[][] edges int numberOfVertices) {
vertices = new ArrayList(); // Create vertices
for (int i = 0; i < numberOfVertices; i++) {
vertices.add((V)(new Integer(i))); // vertices is {0 1 ...}
}
createAdjacencyLists(edges numberOfVertices);
}
/** Create adjacency lists for each vertex */
private void createAdjacencyLists(
int[][] edges int numberOfVertices) {
// Create a linked list
neighbors = new ArrayList>();
for (int i = 0; i < numberOfVertices; i++) {
neighbors.add(new ArrayList());
}
for (int i = 0; i < edges.length; i++) {
int u = edges[i][0];
int v = edges[i][1];
neighbors.get(u).add(v);
}
}
/** Create adjacency lists for each vertex */
private void createAdjacencyLists(
List edges int numberOfVertices) {
// Create a linked list
neighbors = new ArrayList>();
for (int i = 0; i < numberOfVertices; i++) {
neighbors.add(new ArrayList());
}
for (Edge edge: edges) {
neighbors.get(edge.u).add(edge.v);
}
}
/** Return the number of vertices in the graph */
public int getSize() {
return vertices.size();
}
/** Return the vertices in the graph */
public List getVertices() {
return vertices;
}
/** Return the object for the specified vertex */
public V getVertex(int index) {
return vertices.get(index);
}
/** Return the index for the specified vertex object */
public int getIndex(V v) {
return vertices.indexOf(v);
}
/** Return the neighbors of vertex with the specified index */
public List getNeighbors(int index) {
return neighbors.get(index);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 631 2009-10-15 14:06 java答案java答案书本上的例题程序A.class
文件 429 2009-10-15 14:06 java答案java答案书本上的例题程序AbstractGraph$Edge.class
文件 2849 2009-10-15 14:06 java答案java答案书本上的例题程序AbstractGraph$Tree.class
文件 8825 2009-10-15 14:06 java答案java答案书本上的例题程序AbstractGraph.class
文件 12435 2009-04-18 10:32 java答案java答案书本上的例题程序AbstractGraph.java
文件 944 2009-10-15 14:06 java答案java答案书本上的例题程序AbstractTree.class
文件 558 2007-05-13 20:44 java答案java答案书本上的例题程序AbstractTree.java
文件 869 2009-10-15 14:06 java答案java答案书本上的例题程序AccountWithoutSync$Account.class
文件 705 2009-10-15 14:06 java答案java答案书本上的例题程序AccountWithoutSync$AddAPennyTask.class
文件 1636 2009-10-15 14:06 java答案java答案书本上的例题程序AccountWithoutSync.class
文件 1239 2007-05-14 06:32 java答案java答案书本上的例题程序AccountWithoutSync.java
文件 1142 2009-10-15 14:06 java答案java答案书本上的例题程序AccountWithSyncUsingLock$Account.class
文件 645 2009-10-15 14:06 java答案java答案书本上的例题程序AccountWithSyncUsingLock$AddAPennyTask.class
文件 1593 2009-10-15 14:06 java答案java答案书本上的例题程序AccountWithSyncUsingLock.class
文件 1472 2007-05-14 06:32 java答案java答案书本上的例题程序AccountWithSyncUsingLock.java
文件 1770 2009-10-15 14:06 java答案java答案书本上的例题程序ActionInterfaceDemo$MyAction.class
文件 4144 2009-10-15 14:06 java答案java答案书本上的例题程序ActionInterfaceDemo.class
文件 3821 2007-05-14 13:32 java答案java答案书本上的例题程序ActionInterfaceDemo.java
文件 744 2009-10-15 14:06 java答案java答案书本上的例题程序AdapterDemo$1.class
文件 839 2009-10-15 14:06 java答案java答案书本上的例题程序AdapterDemo.class
文件 609 2007-05-13 09:22 java答案java答案书本上的例题程序AdapterDemo.java
文件 1413 2009-10-15 14:06 java答案java答案书本上的例题程序AdditionQuiz.class
文件 548 2007-10-05 22:09 java答案java答案书本上的例题程序AdditionQuiz.java
文件 1252 2009-10-15 14:06 java答案java答案书本上的例题程序Address.class
文件 0 2006-12-29 19:09 java答案java答案书本上的例题程序address.dat
文件 823 2007-05-13 08:13 java答案java答案书本上的例题程序Address.java
文件 636 2009-10-15 14:06 java答案java答案书本上的例题程序AddressBook$1.class
文件 924 2009-10-15 14:06 java答案java答案书本上的例题程序AddressBook$2.class
文件 1049 2009-10-15 14:06 java答案java答案书本上的例题程序AddressBook$3.class
文件 1063 2009-10-15 14:06 java答案java答案书本上的例题程序AddressBook$4.class
............此处省略3564个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)