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

JavaÄÚ²¿ÀࣨInner Class£©

¼òµ¥µÄ˵£¬ÄÚ²¿£¨inner£©ÀàÖ¸ÄÇЩÀඨÒå´úÂë±»ÖÃÓÚÆäËüÀඨÒåÖеÄÀࣻ¶ø¶ÔÓÚÒ»°ãµÄ¡¢ÀඨÒå´úÂ벻ǶÌ×ÔÚÆäËüÀඨÒåÖеÄÀ࣬³ÆÎª¶¥²ã£¨top-level£©Àà¡£¶ÔÓÚÒ»¸öÄÚ²¿À࣬°üº¬Æä¶¨Òå´úÂëµÄÀà³ÆÎªËüµÄÍⲿ£¨outer£©Àà¡£
1 Static member class£¨¾²Ì¬³ÉÔ±Àࣩ
ÀàÉùÃ÷Öаüº¬“static”¹Ø¼ü×ÖµÄÄÚ²¿Àà¡£ÈçÒÔÏÂʾÀý´úÂ룬
Inner1/Inner2/Inner3/Inner4¾ÍÊÇOuterµÄËĸö¾²Ì¬³ÉÔ±Àà¡£¾²Ì¬³ÉÔ±ÀàµÄʹÓ÷½Ê½ÓëÒ»°ã¶¥²ãÀàµÄʹÓ÷½Ê½»ù±¾Ïàͬ¡£
public class Outer{
//just like static method, static member class has public/private/default access privilege levels

//access privilege level: public
public static class Inner1 {
public Inner1() {
//Static member inner class can access static method of outer class
staticMethod();
//Compile error: static member inner class can not access instance method of outer class
//instanceMethod();
}
}

//access privilege level: default
static class Inner2 {

}

//access privilege level: private
private static class Inner3 {
//define a nested inner class in another inner class
public static class Inner4 {
}
}
private static void staticMethod() {
//cannot define an inner class in a method
/*public static class Inner4() {
}*/
}

private void instanceMethod() {
//private static member class can be accessed only in its outer class definition scope
Inner3 inner3 = new Inner3();
//how to use nested inner class
Inner3.Inner4 inner4 = new Inner3.Inner4();
}
}
class Test {
Outer.Inner1 inner1 = new Outer.Inner1();
//Test and Outer are in the same package, so Inner2 can be accessed here
Outer.Inner2 inner2 = new Outer.Inner2();
//Compile error: Inner3 cannot be accessed here
//Outer.Inner3 inner3 = new Outer.Inner3();
}

1.1 ¾²Ì¬³ÉÔ±ÀàÌØÐÔ
¾²Ì¬³ÉÔ±Àà¿É·ÃÎÊÍⲿÀàµÄÈÎ


Ïà¹ØÎĵµ£º

Javaѧϰ±Ê¼Ç

1.staticÉùÃ÷±äÁ¿µÄÓ÷¨ÔÚ»ù´¡ÖªÊ¶ÀïÃæ£»
    JavaÀïÃæstaticÓÃÀ´ÉùÃ÷º¯ÊýµÄ×÷Óãº
      A.¿ÉÒÔ²»Óô´½¨¶ÔÏó£¨ÊµÀý£©£¬¶øÖ±½Óµ÷Ó×—Àà.·½·¨
      B.ÓÃÓÚmainº¯ÊýµÄ·½·¨
2.new——·ÖÅä¿Õ¼äÎÊÌâ
    ÓжàÉÙne ......

[JAVAÓëģʽ]ѧϰ±Ê¼Ç Ò»

      ×÷ΪһÃû³ÌÐòÔ±£¬×ÜÒª¾­Àú´ÓС¹æÄ£µÄ¾Ö²¿±àÂëת»»µ½´óÐÍÈí¼þÉè¼Æ¡¢¿ª·¢µÄ¹ý³Ì¡£Ôڴ˹ý³ÌÖУ¬ÔÚÊìϤÁ˱à³ÌÓïÑÔºó£¬ÐèÒª½«ÑÛ¹âÉÏÉýÒ»¸ö²ãÃæ£¬´ÓÕûÌåÈ¥°ÑÎÕÕû¸öÈí¼þµÄ¼Ü¹¹£¬Õë¶ÔÒ»¸öÐÐÒµµÄ¾ßÌåÒµÎñ£¬Äܹ»Éè¼ÆÒ»¸öºÏÀíµÄ¼Ü¹¹£¬Ìá¸ßÈí¼þµÄ¿É¿¿ÐÔ¡¢¿Éά»¤ÐÔ¡¢¿É¸´ÓÃÐÔ¡£¾ÍÏñһλ¾­Ñé·á¸»µÄͬÊÂËùË ......

ʹÓÃJavaµÈ±ÈÀýËõ·ÅͼÏñ£¡

 Ëõ·ÅͼÏñµÄ»ù±¾Ô­ÀíÊÇ´´½¨Ò»¸öÄ¿±ê´óСµÄ»­²¼£¬È»ºó¶ÁȡԴͼÏñ£¬²¢½«¸ÃͼÏñ»æÖÆÕâ¸ö»­²¼ÉÏ¡£ÎªÁËʹ³ÌÐòͨÓã¬Ô´Í¼ÏñºÍËõ·ÅºóµÄÄ¿±êͼÏñÓ¦Ó÷ֱðʹÓà InputStreamºÍOutputStreamÀ´±íʾ£¬´úÂëÈçÏ£º
     public   static   void  scaleImage(InputStream imgInputStrea ......

ÓÉJAVA²ÎÊý´«µÝÒý·¢µÄ¶ÔÒýÓõÄ˼¿¼

½ñÌìÔÚ±àдһ¸ö¿ìËÙÅÅÐòº¯Êý£¬ÆäÖÐÏëÓÃÒ»¸öÔÚC++ÖÐÀàËÆswap¹¦Äܵĺ¯Êý£¬½á¹ûÒý·¢ÁËһϵÁеÄÎÊÌâ¡£
ÏÂÃæÊÇÔÚÍøÉÏËѵ½µÄ´úÂ룬²¢ÔÚÎҵı¾µØ»úÉÏ×÷ÁËÔËÐС£   
    
  public   class   ParamTest  
  {  
  public   static   void ......

java ÕýÔò±í´ïʽ

Òý£ºAndroid µÄAPIÖÐÓиö java.util.regex °ü£¬ÆäÖÐÓÐÁ½¸öÀ࣬һ¸ö½Ó¿ÚºÍÒ»¸öÒì³££º
Interfaces
MatchResult
Holds the results of a successful match of a Pattern against a given string.
Classes
Matcher
Provides a means of matching regular expressions against a given input,
finding occurrences of ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ