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

java¶¯Ì¬µ÷ÓÃÀà

package tf;
public class TestPack {
public static void main(String [] args)
{
try
{
IAnimal cAnimal = new bird();
cAnimal.shout();
IAnimal animal =(IAnimal)java.lang.Class.forName("tf.bird").newInstance();
animal.shout();
}
catch (Exception e) {
// TODO: handle exception
}
}
}
//tf.bird ¼ÓÉϰüÃû
//bird.java
package tf;
public class bird implements IAnimal{
public void shout()
{
System.out.println("c c jiji ");
}
}
//IAnimal.java
package tf;
public interface IAnimal {
public void shout();
}
c c jiji
c c jiji


Ïà¹ØÎĵµ£º

JAVA ¶ÔÊ÷ÐνṹÖÐͼƬµÄÐÞ¸Ä

package graphic;
import javax.swing.ImageIcon;
import javax.swing.JTree;
import java.awt.Component;
import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.DefaultMutableTreeNode;
/**
*
* @author bianzhiqi
* ¾ßÌå·½·¨µÄʹÓò鿴DefaultTreeCellRendererµÄÎĵµ
*/
public c ......

̸̸javaÈçºÎѧϰ

Çë²»Òª°ÑÄãµÄѧϰJava֮·ºÍÆäËü¼ÆËã»ú¼¼Êõ·Ö¿ª¿´´ý£¬¼¼ÊõµÄÁªÏµÍùÍùÊÇǧ˿ÍòÂÆµÄ£¬ÄãÓ¦¸ÃÕÆÎÕһЩѧϰJavaËùÉæ¼°µÄ»ù´¡ÖªÊ¶£¬¶ÔÓÚ “CLASSPATHÒªÔõôÉèÖð¡”¡¢“¹òÇóJDKÏÂÔØµØÖ·”µÈµÈÎÊÌ⣬Äã²»¸ÃÎÊ£¬ÒòΪInternetÉÏÌ«¶à´ð°¸ÁË£¬ÉõÖÁ»»¸ö½Ç¶È˵£¬ÄãÊDz»ÊÇ»¹²»ÊʺÏÖ±½Óѧϰ±à³Ì£¿
1£©Âò±¾JavaѧϰÓà ......

java¶¨Ê±Æ÷µÄʹÓÃ

¶¨Ê±Æ÷ÀàTimerÔÚjava.util°üÖС£Ê¹ÓÃʱ£¬ÏÈʵÀý»¯£¬È»ºóʹÓÃʵÀýµÄschedule(TimerTask task, long delay)·½·¨£¬É趨ָ¶¨µÄÈÎÎñtaskÔÚÖ¸¶¨µÄÑÓ³ÙdelayºóÖ´ÐС£¶¨Ê±Æ÷ÈÎÎñÀàTimerTaskÊdzéÏóÀ࣬¼Ì³Ð²¢ÖØÐ´Æärun()·½·¨£¬¿ÉʵÏÖ¾ßÌåÈÎÎñ¡£
schedule(TimerTask task, Date time)É趨ָ¶¨ÈÎÎñtaskÔÚÖ¸¶¨Ê±¼ätimeÖ´ÐС£
cancel ......

java½â»ó±Ê¼Ç

½ñÌì³é¿ÕÏÂÁË¡¶java½â»ó¡·Õâ±¾Êé¿´ÁËһϣ¬È·Êµ²»´í£¬Ìá³öÁ˺ܶàÎÒÃÇÆ½Ê±²»»á×¢ÒâµÄСÎÊÌâ¡£ÏëÏëÈç¹û²»×¢Òâ˵²»¶¨»áÒòΪһ¸öBUGÓôÃÆ¸öÒ»Á½ÌìÒ²ÕÒ²»µ½¡£ÒÔÏÂÊÇ×ܽáµÄ±Ê¼Ç£¬±¸Íü~~
1.ÅÐ¶ÏÆæÊý
i % 2 == 1 ÔÚi Ϊ¸ºÊýʱ½á¹ûΪ-1£¬ËùÒÔʹÓÃi % 2 != 0À´Åжϣ»µ±ÓÐÐÔÄÜÒªÇóʱʹÓà (i & 1) != 0¡£
*ÔÚʹÓÃ%ʱһ¶¨Òª¿¼Âǵ ......

³õ̽javaÄÚ´æ»úÖÆ_¶ÑºÍÕ»

³õ̽javaÄÚ´æ»úÖÆ_¶ÑºÍÕ»
ÎÊÌâµÄÒýÈ룺
ÎÊÌâÒ»£º
String str1 = "abc";
String str2 = "abc";
System.out.println(str1==str2); //true
ÎÊÌâ¶þ£º
String str1 =new String ("abc");
String str2 =new String ("abc");
System.out.println(str1==str2); // false
ÎÊÌâÈý£º
String s1 = "ja";
String s2 = "v ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ