java ¼¯ºÏÀà
1.1.1. ¼¯ºÏ¿ò¼ÜÖеĽӿÚ
Ëùν¿ò¼Ü¾ÍÊÇÒ»¸öÀà¿âµÄ¼¯ºÏ¡£¼¯ºÏ¿ò¼Ü¾ÍÊÇÒ»¸öÓÃÀ´±íʾºÍ²Ù×÷¼¯ºÏµÄͳһµÄ¼Ü¹¹£¬°üº¬ÁËʵÏÖ¼¯ºÏµÄ½Ó¿ÚÓëÀà¡£
* Collection£º¼¯ºÏ²ã´ÎÖеĸù½Ó¿Ú£¬JDKûÓÐÌṩÕâ¸ö½Ó¿ÚÖ±½ÓµÄʵÏÖÀà¡£
* Set£º²»ÄÜ°üº¬Öظ´µÄÔªËØ¡£SortedSetÊÇÒ»¸ö°´ÕÕÉýÐòÅÅÁÐÔªËصÄSet¡£
* List£ºÊÇÒ»¸öÓÐÐòµÄ¼¯ºÏ£¬¿ÉÒÔ°üº¬Öظ´µÄÔªËØ¡£ÌṩÁË°´Ë÷Òý·ÃÎʵķ½Ê½¡£
* Map£º°üº¬ÁËkey-value¶Ô¡£Map²»ÄÜ°üº¬Öظ´µÄkey¡£SortedMapÊÇÒ»¸ö°´ÕÕÉýÐòÅÅÁÐkeyµÄMap¡£
1.1.2. ArrayList
* ArrayList£ºÎÒÃÇ¿ÉÒÔ½«Æä¿´×÷ÊÇÄܹ»×Ô¶¯Ôö³¤ÈÝÁ¿µÄÊý×é¡£
* ÀûÓÃArrayListµÄtoArray()·µ»ØÒ»¸öÊý×é¡£
* Arrays.asList()·µ»ØÒ»¸öÁÐ±í¡£
* µü´úÆ÷(Iterator) ¸øÎÒÃÇÌṩÁËÒ»ÖÖͨÓõķ½Ê½À´·ÃÎʼ¯ºÏÖеÄÔªËØ
1.1.3. CollectionÀà
* ÅÅÐò£ºCollections.sort()
£¨1£©×ÔÈ»ÅÅÑ°(natural ordering )£»
£¨2£©ÊµÏֱȽÏÆ÷(Comparator)½Ó¿Ú¡£
* È¡×î´óºÍ×îСµÄÔªËØ£ºCollections.max()¡¢Collections.min()¡£
* ÔÚÒÑÅÅÐòµÄListÖÐËÑË÷Ö¸¶¨µÄÔªËØ£ºCollectons.binarySearch()¡£
1.1.4. LinkedList
* LinkedListÊDzÉÓÃË«ÏòÑ»·Á´±íʵÏֵġ£
* ÀûÓÃLinkedListʵÏÖÕ»(stack)¡¢¶ÓÁÐ(queue)¡¢Ë«Ïò¶ÓÁÐ(double-ended queue )
1.1.5. Êý¾Ý½á¹¹
Ò»°ã½«Êý¾Ý½á¹¹·ÖΪÁ½´óÀࣺÏßÐÔÊý¾Ý½á¹¹ºÍ·ÇÏßÐÔÊý¾Ý½á¹¹¡£ÏßÐÔÊý¾Ý½á¹¹ÓÐÏßÐÔ±í¡¢Õ»¡¢¶ÓÁС¢´®¡¢Êý×éºÍÎļþ£»·ÇÏßÐÔÊý¾Ý½á¹¹ÓÐÊ÷ºÍͼ
1.1.6. ÏßÐÔ±í
* ÏßÐÔ±íµÄÂß¼½á¹¹ÊÇn¸öÊý¾ÝÔªËصÄÓÐÏÞÐòÁÐ:
(a1, a2 ,a3,…an)
nΪÏßÐÔ±íµÄ³¤¶È(n≥0)£¬n=
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
JavaÉú³ÉͼƬÑéÖ¤Âë
import java.io.*;
import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.awt.*;
import java.awt.image.*;
import java.util.*;
import javax.imageio.*;
/**
*
* @author http://www.tot.name
* @version
*/
public cl ......
public class Test {
public static void main(String args[]){
try{
// »ñÈ¡¼üÅÌÊäÈëµÄ×Ö·û´®
BufferReader f = new BufferReader(new inputStreamReader(System.in));
String str = f.readline();
for (int i = str.length() -1 ; i >=0 ; i--) {
System.out.print(CharAt(i)); ......
from: http://www.leftworld.net/online/java/index.html
<Thinking in java>¸½Â¼B ¶Ô±ÈC++ºÍJava
“×÷ΪһÃûC++³ÌÐòÔ±£¬ÎÒÃÇÔçÒÑÕÆÎÕÁËÃæÏò¶ÔÏó³ÌÐòÉè¼ÆµÄ»ù±¾¸ÅÄ¶øÇÒJavaµÄÓï·¨ÎÞÒÉÊǷdz£ÊìϤµÄ¡£ÊÂʵÉÏ£¬Java±¾À´¾ÍÊÇ´ÓC++ÑÜÉú³öÀ´µÄ¡£”
È»¶ø£¬C++ºÍJavaÖ®¼äÈÔ´æÔÚһЩÏÔÖøµÄ²îÒì¡£¿ÉÒÔÕâÑ ......
1¡¢ ¶ÔÏóµÄ³õʼ»¯
(1) ·Ç¾²Ì¬¶ÔÏóµÄ³õʼ»¯
ÔÚ´´½¨¶ÔÏóʱ£¬¶ÔÏóËùÔÚÀàµÄËùÓÐÊý¾Ý³ÉÔ±»áÊ×ÏȽøÐгõʼ»¯¡£
»ù±¾ÀàÐÍ£ºintÐÍ£¬³õʼ»¯Îª0¡£
Èç¹ûΪ¶ÔÏó£ºÕâЩ¶ÔÏó»á°´Ë³Ðò³õʼ»¯¡£
¡ùÔÚËùÓÐÀà³ÉÔ±³õʼ»¯Íê³ÉÖ®ºó£¬²Åµ÷Óñ¾ÀàµÄ¹¹Ôì·½·¨´´½¨¶ÔÏó¡£
¹¹Ôì·½·¨µ ......