java£ºÊÖдMyLinkedListËùÓз½·¨£¬Ôöɾ¸Ä²é
package arrays.myArray;
public class MyLinkedList {
private int size = 0;
private Node1 head = null;
// Ìí¼Ó
public void add(Object obj) {
add(size, obj);
}
// ÐÞ¸Ä
public void add(int index, Object obj) {
if (null == head) {
head = new Node1(obj, null);
} else {
if (0 == index) {
head = new Node1(obj, head);
} else {
Node1 temp = head;
for (int i = 0; i < index - 1; i++) {
temp = temp.next;
}
temp.next = new Node1(obj, temp.next);
}
}
size++;
}
// ÒÆ³ý
public void remove(int index) {
if (0 == index) {
head = head.next;
} else {
Node1 temp = head;
for (int i = 0; i < index - 1; i++) {
temp = temp.next;
}
temp.next = temp.next.next;
}
size--;
}
// ²éѯ
public Object get(int index) {
Node1 temp = head;
for (int i = 0; i < index; i++) {
temp = temp.next;
}
return temp.obj;
}
// ×ܳ¤¶È
public int size() {
return size;
}
}
class Node1 {
Object obj;
Node1 next;
public Node1(Object obj, Node1 next) {
this.obj = obj;
this.next = next;
}
}
Ïà¹ØÎĵµ£º
1. javaÓëÆ½Ì¨Î޹ء£Ô´´úÂëÓɱàÒëÆ÷±àÒëΪ×Ö½ÚÂ루JVM¿ÉÖ´ÐдúÂ룩£»½âÊÍÆ÷ÔËÐÐJVM×Ö½ÚÂ루·ÒëΪ»úÆ÷Â룩¼´¿ÉµÃµ½Êä³ö½á¹û¡£
×Ö½ÚÂë¿ÉÔÚ¶à¸öƽ̨ÔËÐУ¬²»ÐèÒªÖØÐ±àÒë¡£
c±àÒëÆ÷ÔÚ±àÒëʱÉú³ÉµÄ´úÂëÊÇÕë¶ÔÌØ¶¨µÄÓ²¼þƽ̨²úÉúµÄ¡£
2. java¿ª·¢¹¤¾ßJDK¡£°²×°JDKʱ×Ô´øjre£¬¾ÍÊÇjavaÐéÄâ»ú¡£
jdkÊÇJava¿ª·¢¹¤¾ß°ü£¬°üº¬Á˸ ......
ÔٴδÓÍøÉϲéѯ£¬Ëѵ½ÁËRXTXcomm.jar°ü±È½ÏºÃ£¬ÊÇ·â×°ÁËcomm.jarµÄ·½·¨¡£
°²×°£º
1.copy rxtxSerial.dll to [JDK-directory]\jre\bin\rxtxSerial.dll
2.copy RXTXcomm.jar to [JDK-directory]\jre\lib\ext\RXTXcomm.jar
&nbs ......
¼øÓÚÍøÉÏËѵ½µÄ¶¼ÊÇ»ùÓÚjdk1.4»òÒÔǰ°æ±¾£¬¶øÇÒ±¾µØ¿âÓõÄÊÇCÓïÑÔ¡£¶øÏÖÔÚÊÇ»ùÓÚC++£¬ËùÒÔ¸üмǼÈçÏ£º
µÚÒ»²½£º´´½¨JavaÔ´ÂëÎļþ
public class Hello{
static{
System.loa ......
public class Split{
public static void main(String[] args){
double pai = 3.14159;
findTwo(pai);
public static void findTwo(double value){
System.out.println(new DecimalFormat("0.##"). ......
package arrays.compara;
import java.util.Arrays;
public class Student {
public static void main(String[] args) {
Stu[] stus = new Stu[]{
new Stu(156,34,"ad"),
new Stu(153,24,"cc"),
new Stu(126,37,"ab"),
......