java½Ó¿ÚʵÏÖ
java½Ó¿ÚʵÏÖ
¶Ô³õѧÕßÀ´Ëµ£¬½Ó¿Ú²»ÊǺܺÃÀí½â¡£ÏÖ½«Ä³¸ßÊÖµÄһƪÎÄÕÂÌù³öÀ´£¬¹²´ó¼Ò·ÖÏí£¡
ÎÒÃÇÀ´¿´Ò»¸öÀà
class A {
private int a;
public int getA() {
return a;
}
}
Õâ¸öÀàµÄÊôÐÔÊÇ˽Óеģ¬Íâ½ç²»ÄÜ·ÃÎÊ£¬¶øÍâ½ç¿ÉÒÔͨ¹ý¹«Óз½·¨À´·ÃÎÊÕâ¸öÀà¡£ÎÒÃÇ˵һ¸öÀàµÄ¹«Óз½
·¨¾ÍÊÇÕâ¸öÀàµÄ¶ÔÍâ½Ó¿Ú¡£Í¨³£
Ò»¸öÀàµÄÊôÐÔ¶¼ÊÇ˽Óеģ¬·½·¨´ó¶àÊǹ«Óеġ£Íâ½çÖ»Äܹý¸öÕâЩ¹«Óз½·¨À´·ÃÎÊÀà¡£ÕâÒ²ÊÇJava·â×°ÐÔ
µÄÌåÏÖ¡£Èç¹ûÒ»¸öÀàûÓй«ÓÐÊôÐÔ£¬
ҲûÓй«Óз½·¨£¬Õâ¸öÀà¾ÍÊÇÎÞ·¨Ê¹ÓõÄÀàÁË¡£ËùÒÔÎÒÃÇÐèҪΪһ¸öÀàÌṩ¶ÔÍâ½Ó¿Ú¡£
Ò»¸öÀàÖеķ½·¨£¬²»Ö»ÊÇ˵Ã÷ÁËËüÒª“×öʲô”£¬¶øÇÒ·½·¨µÄÄÚÈÝҲ˵Ã÷ÁË“Ôõô×ö”¡£´ò¸ö²»Ì«Ç¡µ±µÄ
Àý×Ó£¬Ò»¸öɱÈË·½·¨¡£´ÓÃû×ÖÉÏ¿´£¬ÄãÖªµÀÁË“×öʲô”£¬µ«Ã»Óа취¿´µ½“Ôõô×ö”¡£¶ø·½·¨µÄÄÚÈÝ˵
Ã÷ÁË“Ôõô×ö”¡£
class killer {
private String name;
private int age;
private String phone;
private String addr;
......
public void kill(Person p) {
Qiang qiang = new Qiang("ak47");
qiang.fire(p);
}
}
Õâ¸öÀàµÄkill·½·¨ÄÚÈÝ˵Ã÷ÁËɱÈ˵Ĺý³Ì¡£Èç¹ûÄã²»ÏëÓÃÕâÖÖ·½Ê½É±ÈË¡£ÒòΪÄãºÜBT£¬ÄãÏëÓö¾Ò©É±ÈË¡£
ÄÇôÕâ¸öÀàµÄÄÚÈݾÍÐèÒª¸Ä¡£µ«ÊÇ£¬»¹ÓкܶàÆäËüµÄ“¿Í»§”£¬ÐèÒªÓò»Í¬µÄ·½Ê½É±ÈË¡£Ôõô°ìÄØ£¿Ò»¸ö
ºÜºÃµÄ°ì·¨¾ÍÊÇ£¬ÎÒÃÇÖ»¶¨Òå“×öʲô”£¬¶ø²»¶¨Òå“Ôõô×ö”¡£
interface Killer {
public void kill(Person p);
}
½Ó¿Ú˵Ã÷ÁË“×öʲô”£¬¶øʵÏÖÕâ¸ö½Ó¿ÚµÄÀ࣬Ҳ¾ÍÊÇʵÏÖÀàÐèҪ˵Ã÷“Ôõô×ö”¡£
class Killer1 implements Killer {
public void kill(Person p) {
Qiang qiang = new Qiang("ak47");
qiang.fire(p);
}
}
class Killer2 implements Killer {
public void kill(Person p) {
Bane bane = new Bane();
p.eat(bane);
}
}
public class Test {
public static void main(String[] args) {
Killer jingKe = new Killer1();
Person yingZheng = new Person();
jingKe.kill(yingZheng);
}
}
½Ó¿Ú¿ÉÒÔ°Ñ“×öʲô”ºÍ“Ôõô×ö”·ÖÀ뿪À´¡£Õâ¸øJava´øÀ´Á˺ܶàºÃ´¦¡£ËäÈ»´úÂëÁ¿Ôö¼ÓÁË£¬¿ÉÎÒÃǵÄ
³ÌÐòµÄ¿Éά»¤ÐÔ¼ÓÇ¿ÁË¡£ÎÒÃǵijÌÐòÊÇ¿ÉÒÔ²ð·ÖµÄ¡£¾ÍÏóµçÄÔÒ»Ñù£¬¿ÉÒÔ²ð·Ö³ÉºÜ¶
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
ÏîÄ¿ÖÐÄã²»µÃ²»ÖªµÄ11¸öJavaµÚÈý·½Àà¿â
ÔðÈα༣ºñûÀï×÷ÕߣºJavaeye 2009-11-02 À´Ô´£ºIT168ÍøÕ¾
Îı¾Tag£º ITÒµ½ç Java Java¿ª·¢¹¤¾ß
¡¡¡¡¡¾IT168 ÆÀÂÛ¡¿JavaµÚÈý·½library ecosystemÊÇÒ»¸öºÜ¹ãÀ«µÄ·¶³ë¡£²»¾ÃÇ°ÓÐÈË׫ÎÄ£ºÃ¿¸öÏîÄ¿ÖУ¬Äã±ØÐëÖªµÀµÄ11¸öJavaµÚÈý·½Àà¿â¡£
¡¡¡¡µ¥Ôª²âÊÔ
¡¡¡¡ ......
1.FileÀàΪ¹ÜÀíÎļþºÍĿ¼ÌṩÁË·½·¨£¬Æä¶ÔÏó±íʾһ¸öÎļþ»òÕßĿ¼¡£ËüÌṩÁËÈô¸É·½·¨¶ÔÎļþ»òÎļþ¼Ð½øÐвÙ×÷¡£ÆäÖеÄlist()·½·¨ºÍlistFiles()·½·¨¿ÉÒÔÆ𵽶¨Î»Ìض¨ÎļþµÄ×÷Óá£
2.ObjectÀ࣬ÊÇËùÓÐJavaÀàµÄ×æÏÈ£¬ÈôÒ»¸öÀàÉùÃ÷ʱûÓаüº¬extends¹Ø¼ü×Ö£¬ÔòÆäÖ±½Ó¼Ì³ÐÓÚObjetcÀà¡£ÆäÖÐÓÐÐí¶àÖØÒª·½·¨£º
equals(),not ......
ÕâÀïµÄ˵µÄjava¿ª·¢»·¾³£¬ÒԴeclipse3.2.1ΪÖ÷Ìâ.
¡¡¡¡1¡¢°²×°ºÃUbuntuϵͳ;°²×°µÄʱºòÇ¿ÁÒ½¨ÒéÁ¬½ÓÉÏÍø£¬Ëü»á×Ô¶¯ÏÂÔØÓïÑÔ°ü£¬×Ô¶¯×°ÉÏÎå±Ê£¬Æ´Òô£¬»¹ÓлáĬÈÏ°Ñfirefoxä¯ÀÀÆ÷ÉèÖÃΪÖÐÎÄ.
¡¡¡¡°²×°Ubuntu±Èwindowsϵͳһ¸ö±È½ÏˬµØ·½¾ÍÊÇ°²×°¿ÉÒÔÒ»±ßÉÏÍøä¯ÀÀ,»¹¿ÉÒÔÊÔÓÃÒ»ÏÂUbuntuµÄ¹¦ÄÜ¡£
¡¡¡¡2¡¢ÅäÖÃUbuntu»·¾³£º ......
Óà Java ½âÃÜ C# ¼ÓÃܵÄÊý¾Ý(DES)
[ÔÎĵØÖ·£ºhttp://yidinghe.cnblogs.com/articles/449212.html]
½ñÌìÅöÉÏÒ»¼þÁîÎÒÍ·´óµÄÊÂÇé¡£ÎÒÃǵÄϵͳҪºÍÒ»¸öÍⲿϵͳ½øÐÐͨѶ£¬´«Ê䷽ʽÊDzÉÓà DES Ëã·¨¶ÔÏûÏ¢½øÐмÓÃÜ£¬ÔÙÓà BASE64 ±àÂë¡£²»¹ý¶Ô·½ÏµÍ³ÊÇÓà C# дµÄ¡£Æ½Ì¨²»Ò»Ñù£¬ÓÚÊÇÎҺͶÔÃæµÄÀÏÐÖÏȲâÊÔһϼÓÃܽâÃÜ¡£ ......