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

java ÄÚ²¿Àà×ܽá

Ò»¡¢ ¶¨Òå
·ÅÔÚÒ»¸öÀàµÄÄÚ²¿µÄÀàÎÒÃǾͽÐÄÚ²¿Àà¡£
¶þ¡¢ ×÷ÓÃ
1.ÄÚ²¿Àà¿ÉÒԺܺõÄʵÏÖÒþ²Ø
  Ò»°ãµÄ·ÇÄÚ²¿À࣬ÊDz»ÔÊÐíÓÐ private ÓëprotectedȨÏ޵ģ¬µ«ÄÚ²¿Àà¿ÉÒÔ
2£®ÄÚ²¿ÀàÓµÓÐÍâΧÀàµÄËùÓÐÔªËصķÃÎÊȨÏÞ
3.¿ÉÊÇʵÏÖ¶àÖؼ̳Ð
4.¿ÉÒÔ±ÜÃâÐ޸ĽӿڶøʵÏÖͬһ¸öÀàÖÐÁ½ÖÖͬÃû·½·¨µÄµ÷Óá£
Èý¡¢   Àý×Ó
1.ʵÏÖÒþ²Ø
   ƽʱÎÒÃǶÔÀàµÄ·ÃÎÊȨÏÞ£¬¶¼ÊÇͨ¹ýÀàÇ°ÃæµÄ·ÃÎÊÐÞÊηûÀ´ÏÞÖƵģ¬Ò»°ãµÄ·ÇÄÚ²¿À࣬ÊDz»ÔÊÐíÓÐ private ÓëprotectedȨÏ޵ģ¬µ«ÄÚ²¿Àà¿ÉÒÔ£¬ËùÒÔÎÒÃÇÄÜͨ¹ýÄÚ²¿ÀàÀ´Òþ²ØÎÒÃǵÄÐÅÏ¢¡£¿ÉÒÔ¿´ÏÂÃæµÄÀý×Ó
½Ó¿Ú
package insidecategory;
public interface Incrementable
{
  void increment();
}
¾ßÌåÀà
package insidecategory;
public class Example {
  
    private class InsideClass implements InterfaceTest
    {
         public void test()
         {
             System.out.println("ÕâÊÇÒ»¸ö²âÊÔ");
         }
    }
    public InterfaceTest getIn()
    {
        return new InsideClass();
    }
}
ÉÏÃæ¼Ó´ÖµÄ²¿·ÖÊÇÄÚ²¿À࣬·ÃÎÊÐÞÊηûÊÇprivate
¿Í»§¶Ë³ÌÐò
package insidecategory;
public class TestExample {
  public static void main(String args[])
  {
    Example a=new Example();
    InterfaceTest a1=a.getIn();
    a1.test();
  }
}
¼Ó´ÖµÄÄDz¿·Ö¾ÍÊÇ¿Í»§¶Ëµ÷ÓõĴúÂ룬´ÓÕâ¶Î´úÂëÀïÃæÎÒÖ»ÖªµÀExampleµÄ
getIn()·½·¨ÄÜ·µ»ØÒ»¸öInterfaceTest ʵÀýµ«ÎÒ²¢²»ÖªµÀÕâ¸öʵÀýÊÇÕâôʵÏֵġ£¶øÇÒÓÉÓÚInsideClass ÊÇprivateµÄ£¬ËùÒÔÎÒÃÇÈç¹û²»¿´´úÂëµÄ»°¸ù±¾¿´²»µ½Õâ¸ö¾ßÌåÀàµÄÃû×Ö£¬ËùÒÔ˵Ëü¿ÉÒԺܺõÄʵÏÖÒþ²Ø¡£
2.¿ÉÒÔÎÞÌõ¼þµØ·ÃÎÊÍâΧÀàµÄËùÓÐÔªËØ
package insidecategory;
public class TagBean {
 private String name="liutao";
   private class InTest
  


Ïà¹ØÎĵµ£º

javaÒýÓÃ


class Tank{
 int level;
}
public class Assignment {
 public static void main(String[] args) {
  
  Tank t1 = new Tank();
  Tank t2 = new Tank();
  t1.level= 9;
  t2.level= 47;
  
  System.out.println("1:t1.l ......

¹ØÓÚJava IOÁ÷ѧϰ×ܽá

Ò»¡¢IOÁ÷µÄÈýÖÖ·ÖÀ෽ʽ
    1.°´Á÷µÄ·½Ïò·ÖΪ£ºÊäÈëÁ÷ºÍÊä³öÁ÷
    2.°´Á÷µÄÊý¾Ýµ¥Î»²»Í¬·ÖΪ£º×Ö½ÚÁ÷ºÍ×Ö·ûÁ÷
    3.°´Á÷µÄ¹¦Äܲ»Í¬·ÖΪ£º½ÚµãÁ÷ºÍ´¦ÀíÁ÷
    ¶þ¡¢IOÁ÷µÄËÄ´ó³éÏóÀࣺ
    ×Ö·ûÁ÷£ºReader Writer
    × ......

javaÖÐStringÓëStringBufferµÄÇø±ð

ÔÚjavaÖÐÓÐ3¸öÀàÀ´¸ºÔð×Ö·ûµÄ²Ù×÷¡£
 
1.Character ÊǽøÐе¥¸ö×Ö·û²Ù×÷µÄ£¬
 
2.String ¶ÔÒ»´®×Ö·û½øÐвÙ×÷¡£²»¿É±äÀà¡£
 
3.StringBuffer Ò²ÊǶÔÒ»´®×Ö·û½øÐвÙ×÷£¬µ«ÊǿɱäÀà¡£
 
String:
ÊǶÔÏó²»ÊÇԭʼÀàÐÍ.
Ϊ²»¿É±ä¶ÔÏó,Ò»µ©±»´´½¨,¾Í²»ÄÜÐÞ¸ÄËüµÄÖµ.
¶ÔÓÚÒѾ­´æÔÚµÄString¶ÔÏóµÄÐÞ¸ ......

java´ò°üexe ÖÆ×÷°²×°°ü With JRE ×ÔÆô¶¯

Ä¿±ê:Óа²×°³ÌÐò°üÏñ°²×°qqÒ»Ñù¼òµ¥Ò»Ö±ÏÂÒ»²½¼´¿É ,¿ÉжÔØ,ÒªÇó³ÌÐò×Ô¶¯Æô¶¯,²»ÐèÒªµ¥¶À°²×°JRE,¾ÍÔÚдÕâÌ×½â¾ö·½°¸µÄʱºò,ÎÒÕæÊÇ°Ù°ãÍ´ºÞ΢Èí.°¥ÎÞÄΰ¡.ÐÒºÃ×îÖÕ»¹ÊDZ»ÎÒÏë³öÀ´ÁË,·ÖÏíÏ°ɡ£
 
µÚÒ»²½
jre¼õ·Ê,ɾ³ýjre\lib\rt.jarÖв»Ê¹ÓõÄÀà,ɾ³ýcharsets.jarÖв»Ê¹ÓõÄ×Ö·û¼¯±àÂë.MyWork¿ªÔ´ÏîÄ¿(http://mywor ......

Java²Ù×÷OracleÊý¾Ý¿â£¨½¨±í£¬²åÊý¾Ý£¬É¾³ý£©

ÓÃjpa²»Äܽ¨±í£¬sqlÓï¾äÊǶԵģ¬²»¹ý¾ÍÊDz»Äܽ¨£¬Í¬ÑùµÄsql£¬ÔÚÏÂÃæµÄjdbcÖоͿÉÒÔ£¬¿ÉÄÜÊÇ¿ò¼ÜµÄÏÞÖÆ£¬Ï£Íû¸ßÈËÖ¸µã
import java.net.URL;
import java.sql.*;
public class Create {
public Create() {
}
public static void main(String[] args){
String url = "jdbc:oracle:thin:@10.0.1.3:1521:SDCDB" ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ