Java Êý×é µÄ ¿½±´
¸´ÖÆÊý×éµÄ·½·¨£º
ÔÚJAVAÀïÃ棬¿ÉÒÔÓø´ÖÆÓï¾ä“A=B”¸ø»ù±¾ÀàÐ͵ÄÊý¾Ý´«µÝÖµ£¬µ«ÊÇÈç¹ûA,BÊÇÁ½¸öͬÀàÐ͵ÄÊý×飬¸´ÖƾÍÏ൱ÓÚ½«Ò»¸öÊý×é±äÁ¿µÄÒýÓô«µÝ¸øÁíÒ»¸öÊý×飻Èç¹ûÒ»¸öÊý×é·¢Éú¸Ä±ä£¬ÄÇôÒýÓÃͬһÊý×éµÄ±äÁ¿Ò²Òª·¢Éú¸Ä±ä¡£
ÒÔÏÂÊǹéÄɵÄJAVAÖи´ÖÆÊý×éÔªËØÖµµÄµÄ·½·¨£º£¨É±´£©
1¡£Ê¹ÓÃFORÑ»·£¬½«Êý×éµÄÿ¸öÔªËظ´ÖÆ£¨ÐèÒª½«Ã¿¸ö¶ÔÏóµ÷ÓÃclone·½·¨£¬²ÅÄÜʵÏÖÕæÕýµÄ¸´ÖÆ£©
2¡£Ê¹ÓÃclone·½·¨£¬µÃµ½Êý×éµÄÖµ£¬¶ø²»ÊÇÒýÓÃ
3¡£Ê¹ÓÃSystem.arraycopy(s,start1,t,start2,length)·½·¨
£¨×¢Ò⣺sÊÇÔÊý×飬tÊÇÄ¿±êÊý×飬start1£¦start2ÊÇ¿ªÊ¼¸´ÖÆϱ꣬lengthÒ»°ãÊÇsµÄ³¤¶È£¬ÓÉÓÚarraycopy·½·¨²»¸øÄ¿±êÊý×é·ÖÅäÄÚ´æ¿Õ¼ä£¬ËùÒÔ±ØÐèÒªÏÈΪt·ÖÅäÄÚ´æ¿Õ¼ä£¡£©
×¢Ò⣺
1.ÉÏÃæ·½·¨ÖÐarraycopyЧÂʽϸߡ£
2. ÒÔÉÏËù˵µÄ¿½±´Êý×éµÄ·½·¨£¬Ö»ÊÇÕë¶ÔһάÊý×飬¶ÔÓÚ¶àάÊý×飬ҪÔÚÿһάÓÃÒÔÉÏ·½·¨½øÐи´ÖƲÅÄÜʵÏÖ¸´ÖÆÊý×éÔªËصÄÖµ¶ø²»ÊÇÒýÓá£
3. clone ºÍ arraycopy¶Ô¶þάÊý×é½øÐи´ÖÆʱ£¬ÊÇdz¿½±´£¬ ¼´
Object[][] aa;
Object[][] bb = aa.clone();
//or bb£½System.arraycopy(aa,0,bb, 0, bb.length);
Ôò£º
boolean b1 = ( aa[i] == bb[i] ); //true
boolean b2 = (aa[i][j] == bb[i][j]); //true, ¿É¼ûÊý×éÔªËØÖ»¸´ÖÆÁËÒýÓá£Ð¾ÉÊý×éÖ¸ÏòÏàͬµÄÄÚ´æµØÖ·¡££¨²»ÂÛ¶ÔÏóÊý×飬»¹ÊÇ»ù±¾ÀàÐÍÊý×飩
//ÒÔÏÂÊÇÀý³Ì
public class Test {
public static void main(String[] args) {
/*
* ¶ÔÏóµÄÒýÓô«µÝ
*/
// A a = new A();
// B b = new B(a);
// System.out.println( a.getName() );
// System.out.println( b.getA().getName() );
// System.out.println( a==b.getA() );
// a.setName("KE");
// System.out.println( b.getA().getName() );
Ïà¹ØÎĵµ£º
package cn.ctgu.edu.ac;
import java.sql.*;
public class test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String url="jdbc:sqlserver://localhost:1433;Database=ÍøÉÏÊéµê¹ÜÀíϵͳ;integr ......
Ò».µã»÷ͼÊ飬չʾ¸ÃÊéµÄÏêϸÐÅÏ¢
µã»÷ͼÊé→booksÒ³Ãæ→ͨ¹ýurlÖØдdisplayBook.jsp?isbn=¸ÃÊé±àºÅ →´«ÈëdisplayBooksÒ³Ãæ→
<c:set var="isbn" value="${param.isbn}"></c:set>
<c:forEach var="currentBook" items="${sessionScope.bookTitles}">
<c:if test="${ ......
Õ⼸Ìì²âÊÔblob»ñÈ¡ºÍ´æ´¢µÄʱºò,±»¿¨Á˺ܾÃ,×îºó²Å·¢ÏÖÊÇÕ¼ÓÃÁ˹ؼü×Öµ¼ÖÂÎÞ·¨»ñÈ¡½á¹û,ѪµÄ½Ìѵ°¡.
ÒÔºóÆðÃû×ÖÒªÓÃ×î¶ñÐĵÄ,²»ÒªÓÃ×î·½±ãµÄÁË.Ïл°ÉÙ˵,javaµÄhashmapÊDz»ÄÜÖ±½Ó´æ´¢µ½Êý¾Ý¿âÖеÄ.
±¾µØÊý¾Ý¿âΪmysql,ÀïÃæÓÐblobµÄÀàÐͿɹ©Ê¹ÓÃ.·½·¨Ò²ºÜ¼òµ¥,ÉÏ´úÂë
Êý¾Ý¿â½¨±í
CREATE TABLE `test` (
`id` ......
¿Î³ÌÄÚÈÝ
¸ü¼ÓʵÓÿÆѧµÄJava»ù´¡¿Î³Ì
¾ßÓÐÔúʵµÄ±àÂ빦µ×ÊÇÒ»¸öJava¹¤³Ìʦ±Ø±¸µÄÄÜÁ¦£¬ÎÒÃÇÁ¦Çó´ÓѧԱ½Ó´¥JavaµÄµÚÒ»ÌìÆð¾ÍÅàÑøÆäÐγÉÕýȷ˼¿¼ÎÊÌâµÄ·½Ê½¡£ÎÒÃǵĹØ×¢µã²»½ö½öÔÚÓÚ¶Ôij¸öÀà¿â£¨API£©µÄÕÆÎÕ£¬¸ü¶àµÄÊÇÏòѧԱչʾÆóÒµÖÐÕæÕýÒªÖØÊÓµÄÎÊÌ⣬ÀýÈçÒì³£ÈçºÎ´¦Àí¡¢Ëã·¨ÈçºÎÓÅ»¯µÈ¡£Í¬Ê±£¬ÎÒÃÇ×¢ÖØÈÃѧԱÑø³ÉÁ¼ºÃµ ......
JAVAÐéÄâ»úÓÐÒ»¸ö×Ö·û´®³Ø,¶ÔÓÚ×Ö·û´®³ØµÄ·ÃÎÊ¿ÉÒÔʹÓÃ×Ö·û´®¶ÔÏóµÄintern()·½·¨,¿É¶¯Ì¬Ïò³ØÖÐÌí¼Ó¶ÔÏó,ËüµÄ¶¨ÒåÈçÏÂ:
public native String intern();
ÕâÊÇÒ»¸ö±¾µØ·½·¨,ÔÚµ÷ÓÃÕâ¸ö·½·¨Ê±,JAVAÐéÄâ»úÊ×Ïȼì²é×Ö·û´®³ØÖÐÊÇ·ñ´æÔÚÓë¸Ã×Ö·û´®¶ÔÏóÖµÏàµÈµÄ¶ÔÏó,Èç¹û´æÔھͷµ»Ø×Ö·û´®³ØÖеĶÔÏóµÄÒýÓÃ,·ñÔò¾Íд´½¨Ò»¸ö ......