JavaʵÏÖ¶ÓÁвÙ×÷
import java.util.LinkedList;
//µ¥Ïò¶ÓÁÐ
public class Queue {
public Queue() {
}
private LinkedList list = new LinkedList();
public void put(Object v) {
list.addFirst(v);
}
public Object get() {
return list.removeLast();
}
public boolean isEmpty() {
return list.isEmpty();
}
}
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
// Ë«Ïò¶ÓÁÐ
public class DQueue implements Collection {
private LinkedList lists;
public DQueue() {
lists = new LinkedList();
}
public void put_front(Object v) {
lists.addFirst(v);
}
public void put_back(Object v) {
lists.addLast(v);
}
public Object get_front() {
return lists.removeFirst();
}
public Object get_Back() {
return lists.removeLast();
}
public boolean isEmpty() {
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
String Óë StringBufferÇø±ð:
String×Ö·û´®¶ÔÏóÊDz»¿É±äµÄ£»StringBufferÊDZ䳤ºÍ¿ÉдµÄ¶¯Ì¬×Ö·ûÐòÁУ¬¿ÉÒÔ×Ô¶¯µØÔö¼Ó¿Õ¼ä¡£
Integer var = new Integer();//ÓÐÓï·¨´íÎó
Integer var = new Integer(2);//悦﵀
javaµÄVector³ÉÔ±ÊÇÒªÓÃelementAt(i)³ÉÔ±º¯ÊýÀ´»ñµÃµÄ£¬²»ÄÜÓÃve[i]µÃµ½¡£
Vector::public Enumeration< ......
½â¾öÕ»ºÍ¶ÑÄÚ´æÒç³ö°ì·¨ÒªÉèÖû·¾³ÄÚ´æ±äÁ¿£º
1¡¢ÔÚÔËÐнçÃ棨cmd½øÈ룩ÖÐÔËÐÐÃüÁjava -Xms256m -Xmx1024m£¬Î¬»¤ÉÏÏÂÏÞÄÚ´æ²ÎÊý£¬×î´óÄÚ´æ²»ÄÜ´í¹ýϵͳÄÚ´æµÄ1/4£¬×îСÄÚ´æ²»ÄÜСÓÚ×î´óÄÚ´æµÄ1/4
2¡¢ÔÚTommcat /bin·¾¶Ï£¬Èç¹ûÊÇ°²×°°æÐèÒªservice.batÎļþ,´ËÎļþÔÚ½âѹËõ°æÀï¡£
3¡¢ ÔÚÔËÐнçÃ棨cmd½øÈ룩ÖÐ
......
Vector : »ùÓÚArrayµÄList£¬Æäʵ¾ÍÊÇ·â×°ÁËArrayËù²»¾ß±¸µÄһЩ¹¦ÄÜ·½±ãÎÒÃÇʹÓã¬Ëü²»¿ÉÄÜ×ßÈëArrayµÄÏÞÖÆ¡£ÐÔÄÜÒ²¾Í²»¿ÉÄÜ
³¬Ô½Array¡£ËùÒÔ£¬ÔÚ¿ÉÄܵÄÇé¿öÏ£¬ÎÒÃÇÒª¶àÔËÓÃArray¡£ÁíÍâºÜÖØÒªµÄÒ»µã¾ÍÊÇVector“sychronized”µÄ£¬Õâ¸öÒ²ÊÇVectorºÍ
ArrayListµÄΨһµÄÇø±ð¡£
ArrayList£ºÍ¬VectorÒ»ÑùÊÇÒ»¸ö»ùÓ ......
Ò»¸öjavaÎļþÖУ¬ÓÐÇÒÖ»ÓÐÒ»¸öpublicÀà
float ff= 1.3f;(4B)
int 4B;
long 8B;
double 8B;
byte Ò»×Ö½ÚÕûÐÍ
char 2B
Êý×é
int num[] = new int[3];
int[] num;
num = new int[3];
int [] num = new int[]{1,2,3};
int [][] num;
num = new int[3][4];
//²»Í¬³¤
num = new int[3][];
num[0] = new int[5]; ......