Java»ùÓÚ¿ÉÀ©³äÊý×éµÄÏòÁ¿ÊµÏÖ(Ëã·¨Ô´Âë)
/* ¸ßÊÖÖ®×÷£¬±¾È˽÷ÒÔÊÕ²ØÕßÉí·ÝÄóö¹²Ïí¹©´ó¼Ò²Î¿¼! */
/*
* ÏòÁ¿½Ó¿Ú
*/
package dsa;
public interface Vector {
//·µ»ØÏòÁ¿ÖÐÔªËØÊýÄ¿
public int getSize();
//ÅжÏÏòÁ¿ÊÇ·ñΪ¿Õ
public boolean isEmpty();
//È¡ÖÈΪrµÄÔªËØ
public Object getAtRank(int r)
throws ExceptionBoundaryViolation;
//½«ÖÈΪrµÄÔªËØÌ滻Ϊobj
public Object replaceAtRank(int r, Object obj)
throws ExceptionBoundaryViolation;
//²åÈëobj£¬×÷ΪÖÈΪrµÄÔªËØ£»·µ»Ø¸ÃÔªËØ
public Object insertAtRank(int r, Object obj)
throws ExceptionBoundaryViolation;
//ɾ³ýÖÈΪrµÄÔªËØ
public Object removeAtRank(int r)
throws ExceptionBoundaryViolation;
}
/*
* »ùÓÚÊý×éµÄÏòÁ¿ÊµÏÖ
*/
package dsa;
public class Vector_Array implements Vector {
private final int N = 1024;//Êý×éµÄÈÝÁ¿
private int n = 0;//ÏòÁ¿µÄʵ¼Ê¹æÄ£
private Object[] A;//¶ÔÏóÊý×é
//¹¹Ô캯Êý
public Vector_Array() {
A = new Object[N];
n = 0;
}
//·µ»ØÏòÁ¿ÖÐÔªËØÊýÄ¿
public int getSize() { return n; }
//ÅжÏÏòÁ¿ÊÇ·ñΪ¿Õ
public boolean isEmpty() { return (0 == n) ? true : false; }
//È¡ÖÈΪrµÄÔªËØ
public Object getAtRank(int r)//O(1)
throws ExceptionBoundaryViolation {
if (0 > r || r >= n) throw new ExceptionBoundaryViolation("ÒâÍ⣺ÖÈÔ½½ç");
return A[r];
}
//½«ÖÈΪrµÄÔªËØÌ滻Ϊobj
public Object replaceAtRank(int r, Object obj)
throws ExceptionBoundaryViolation {
if (0 > r || r >= n) throw new ExceptionBoundaryViolation("ÒâÍ⣺ÖÈÔ½½ç");
Object bak = A[r];
A[r] = obj;
return bak;
}
//²åÈëobj£¬×÷ΪÖÈΪrµÄÔªËØ£»·µ»Ø¸ÃÔªËØ
public Object insertAtRank(int r, Object obj)
throws ExceptionBoundaryViolation {
if (0 > r || r > n) throw new ExceptionBoundaryViolation("ÒâÍ⣺ÖÈÔ½½ç");
if (n >= N) throw n
Ïà¹ØÎĵµ£º
Ubuntu Linux Install Sun Java Development Kit ( JDK ) and Java Runtime Environment ( JRE )
by Vivek Gite
Q.
How do I install Sun
Java Development Kit (JDK) and Java Runtime Environment (JRE) under
Ubuntu Linux? It appears that there are multiple JRE installed by
default under Ubuntu. ......
ÎÒ½ñÌìѧϰÁËsqlÓï¾äµÄ³£Óú¯Êý£¬ÊÇ·ëÍþÀÏʦ½²µÄ£¬ÎÒ×öÁ˼òµ¥µÄ±Ê¼Ç£º
Ò»£¬SQLº¯Êý£º
1. ´óСдת»»º¯Êý
lower ת³ÉСд
upper ´óд
initcap ½«×Ö·û´®µÄ(ÿ¸öµ¥´ÊµÄ)µÚÒ»¸ö×Öĸ±äΪ´óд,ºóÃæµÄСд
select initcap('huangHY') from dual
&n ......
Ê×ÏÈÃ÷È·ÏÂÀà¼ÓÔصĶ¨Ò壬Àà¼ÓÔØʵ¼ÊÉϾÍÊǽ«java classÎļþ¼ÓÔص½java ÐéÄâ»úÖУ¬¸ù¾ÝJVM¹æ·¶µÄ¶¨Ò壬һ°ã·ÖΪ2ÖÖÀàÐ͵ÄÀà¼ÓÔØ£¬Ò»ÖÖÊÇÆô¶¯Àà¼ÓÔØÆ÷£¬ÁíÍâÒ»ÖÖÊÇÓû§×Ô¶¨ÒåÀà¼ÓÔØÆ÷¡£
Ò» Æô¶¯Àà¼ÓÔØÆ÷¡£
Æô¶¯Àà¼ÓÔØÆ÷Ò²ÓÐÒÔÏÂÈýÖÖ£ºBootstrap ClassLoader¡¢AppClassLoaderºÍExtClassLoader,ÕâÈýÖÖclassloaderÔÚjavaÐéÄâ» ......
public class Bean1 {
private String strValue;
private int intValue;
private List listValue;
private Set setValue;
private String[] arrayValue;
private Map mapValue;
public String getStrValue() {
return strValue;
}
public void setStrValue(String strValue) {
t ......