Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

»ñÈ¡ÆÕͨJava¶ÔÏó´óС

»º´æ¶ÔÏóÐèÒªÖªµÀ¶ÔÏóÕ¼ÓÿռäµÄ´óС,¿ÉÒÔÊÂÏÈÉèÖúÃÿÖÖÀàÐ͵ĴóС,´Ë·½·¨¶ÔÆÕͨµÄ¶ÔÏóÆðЧ,JiveÂÛ̳ÖеĶÔÏóÒ²ÊDzÉÓÃÕâÖÖ°ì·¨À´»ñÈ¡¶ÔÏóµÄ´óСµÄ(È¡×ÔJive).
public class CacheSizes {
/**
* Returns the size in bytes of a basic Object. This method should only
* be used for actual Object objects and not classes that extend Object.
*
* @return the size of an Object.
*/
public static int sizeOfObject() {
return 4;
}
/**
* Returns the size in bytes of a String.
*
* @param string the String to determine the size of.
* @return the size of a String.
*/
public static int sizeOfString(String string) {
if (string == null) {
return 0;
}
return 4 + string.length()*2;
}
/**
* Returns the size in bytes of a primitive int.
*
* @return the size of a primitive int.
*/
public static int sizeOfInt() {
return 4;
}
/**
* Returns the size in bytes of a primitive char.
*
* @return the size of a primitive char.
*/
public static int sizeOfChar() {
return 2;
}
/**
* Returns the size in bytes of a primitive boolean.
*
* @return the size of a primitive boolean.
*/
public static int sizeOfBoolean() {
return 1;
}
/**
* Returns the size in bytes of a primitive long.
*
* @return the size of a primitive long.
*/
public static int sizeOfLong() {
return 8;
}
/**
* Returns the size in bytes of a primitive double.
*
* @return the size of a primitive double.
*/
public static int sizeOfDouble() {
return 8;
}
/**
* Returns the size in bytes of a Date.
*
* @return the size of a Date.
*/
public static int sizeOfDate() {
return 12;
}
/**
* Returns the size in bytes of a Properties object


Ïà¹ØÎĵµ£º

Java±à³ÌÄÇЩʶù67——thisºÍsuper

8.8 thisºÍsuper
         ÏÂÃæÔÙÀ´½éÉÜÒ»ÏÂthisºÍsuper¹Ø¼ü×ÖµÄʹÓá£ÔÚ³ÌÐòÖÐͨ¹ýʹÓÃthisºÍsuper¹Ø¼ü×Ö£¬¿ÉÒÔʵÏÖ¶ÔÓÚÀàÄÚ²¿ºÜ¶àÄÚÈÝ·½±ãµÄÒýÓã¬Ò²ÓÐÖúÓÚÀí½âÃæÏò¶ÔÏóµÄʵÏÖÔ­Àí£¬¸ü·½±ãµÄÀí½âÃæÏò¶ÔÏó¼¼ÊõµÄÄÚ²¿ÊµÏÖ¡£
8.8.1 this¹Ø¼ü×Ö
     &n ......

Java¶ÔÏóÐòÁл¯ºÍ·´ÐòÁл¯

µ±Á½¸ö½ø³ÌÔÚ½øÐÐÔ¶³ÌͨÐÅʱ£¬±Ë´Ë¿ÉÒÔ·¢Ë͸÷ÖÖÀàÐ͵ÄÊý¾Ý¡£ÎÞÂÛÊǺÎÖÖÀàÐ͵ÄÊý¾Ý£¬¶¼»áÒÔ¶þ½øÖÆÐòÁеÄÐÎʽÔÚÍøÂçÉÏ´«ËÍ¡£·¢ËÍ·½ÐèÒª°ÑÕâ¸öJava¶ÔÏóת»»Îª×Ö½ÚÐòÁУ¬¼´Java¶ÔÏóÐòÁкţ¬²ÅÄÜÔÚÍøÂçÉÏ´«ËÍ£»½ÓÊÕ·½ÔòÐèÒª°Ñ×Ö½ÚÐòÁÐÔÙ»Ö¸´ÎªJava¶ÔÏ󣬼´·´ÐòÁл¯¡£
°ÑJava¶ÔÏóת»»Îª×Ö½ÚÐòÁеĹý³Ì³ÆΪ¶ÔÏóµÄÐòÁл¯¡£
°Ñ×Ö½ ......

javaÕýÔò±í´ïʽÈëÃÅ

ÖÚËùÖÜÖª£¬ÔÚ³ÌÐò¿ª·¢ÖУ¬ÄÑÃâ»áÓöµ½ÐèҪƥÅä¡¢²éÕÒ¡¢Ìæ»»¡¢ÅжÏ×Ö·û´®µÄÇé¿ö·¢Éú£¬¶øÕâЩÇé¿öÓÐʱÓֱȽϸ´ÔÓ£¬Èç¹ûÓô¿±àÂ뷽ʽ½â¾ö£¬ÍùÍù»áÀ˷ѳÌÐòÔ±µÄʱ¼ä¼°¾«Á¦¡£Òò´Ë£¬Ñ§Ï°¼°Ê¹ÓÃÕýÔò±í´ïʽ£¬±ã³ÉÁ˽â¾öÕâһì¶ÜµÄÖ÷ÒªÊֶΡ£
´ó¼Ò¶¼ÖªµÀ£¬ÕýÔò±í´ïʽÊÇÒ»ÖÖ¿ÉÒÔÓÃÓÚģʽƥÅäºÍÌæ»»µÄ¹æ·¶£¬Ò»¸öÕýÔò±í´ïʽ¾ÍÊÇÓÉÆÕͨµ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ