JAVA×¢½â
AnnotationÊÇJava5¡¢6Ö»ºóµÄÐÂÌØÕ÷£¨ÖÐÎijÆ֮Ϊע½â£©£¬²¢ÇÒÔ½À´Ô½¶àµÄµÃµ½ÁËÓ¦Ó㬱ÈÈçSpring¡¢Hibernate3¡¢Struts2¡¢iBatis3¡¢JPA¡¢JUnitµÈµÈ¶¼µÃµ½Á˹㷺ӦÓã¬Í¨¹ýʹÓÃ×¢½â£¬´úÂëµÄÁé»îÐÔ´ó´óÌá¸ß¡£
ÕâЩ¶¼ÊÇʹÓñðÈ˶¨ÒåµÄ×¢½â£¬Ò»°ã×¢½âµÄʹÓö¼ÊÇÔÚһЩ»ù´¡¿ò¼Ü»òÕßÀà¿âÖÐÀ´¶¨ÒåµÄ£¬Òò´ËºÜÉÙ¼û¹ýÓÐÈË×Ô¼ºÈ¥Ð´Ò»¸ö×¢½â³öÀ´²¢Ê¹ÓÃÔÚ³ÌÐòÖУ¬Òò´Ë×¢½âµÄʹÓó£³£¸øÈ˸оõºÜÉñÃØ£¬Õâ¾ÍΪÄã½Ò¿ª×¢½âµÄÃæÉ´¡£
×¢½âµÄÉñÃØÖ®´¦ÔÚÓÚ£ºÍ¨¹ýÀàËÆ×¢Ê͵ķ½Ê½£¬¿ÉÒÔ¿ØÖƳÌÐòµÄһЩÐÐΪ£¬ÔËÐÐʱµÄ״̬£¬¿ÉÒÔΪ³ÉÔ±¸³Öµ£¬×öÅäÖÃÐÅÏ¢µÈµÈ£¬Óë³£¹æ±àÂë˼ά´óÏྶͥ¡£
Ö»ÓñðÈ˶¨ÒåºÃµÄ×¢½âÊǸ㲻¶®ÕâЩÎÊÌâµÄ£¬ÒªÏëÕæÕýÖªµÀ×¢½âÄÚ²¿µÄÃØÃÜ£¬Òª×Ô¼º¶¨Òå×¢½â£¬È»ºóÔÚ³ÌÐòÖлñȡע½âÐÅÏ¢£¬Äõ½×¢½âÐÅÏ¢ºó£¬¾Í¿ÉÒÔΪÎÒËùÓÃÁË¡£
ÏÂÃæÎÒ¼òµ¥ÑÝʾÏÂÈýÀà×¢½âµÄÓ÷¨£ºÀà×¢½â¡¢·½·¨×¢½â¡¢×ֶΣ¨Ò²³ÆÖ®Óò£©×¢½âµÄ¶¨ÒåÓëÊÊÓ㬲¢¿´¿´ÈçºÎ»ñȡע½âµÄÐÅÏ¢¡£
Ò»¡¢¶¨Òå×¢½â
package lavasoft.anntest;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Àà×¢½â
*
* @author leizhimin 2009-12-18 14:15:46
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface MyAnnotation4Class {
public String msg();
}
package lavasoft.anntest;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* ·½·¨×¢½â
*
* @author leizhimin 2009-12-18 14:16:05
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface MyAnnotation4Method {
public String msg1();
&
Ïà¹ØÎĵµ£º
¡¾Ö÷Ìâ¡¿ Java»ù±¾Êý¾ÝÀàÐ͵ÄÔËËã
¡¾¹Ø¼ü×Ö¡¿java »ù±¾Êý¾ÝÀàÐÍ
¡¾ÎÊÌâÃèÊö¡¿Çë¿´Èç¹ûÒ»¶Î´úÂë,Èç¹û²»ÔÚeclipseÀïÔËÐÐ,Çëд³öÊä³ö½á¹û
public static void main(String[] args) {
&n ......
ÔÚËùÓеÄJavaÊé¼®µ±ÖУ¬Æäʵ×î×îÓÐÓõģ¬²¢²»ÊÇO′reillyµÄ Java Serials£¬ÕæÕý×î×îÓÐÓô¦ÊÇJDKµÄÎĵµation£¡¼¸ºõÄãÏë»ñµÃµÄËùÓеÄ֪ʶÔÚÎĵµationÀïÃæÈ«²¿¶¼ÓУ¬ÆäÖÐ×îÖ÷ÒªµÄ²¿·Öµ±È»ÊÇJava»ù´¡Àà¿âµÄAPIÎĵµ£¬ÊÇ°´ÕÕpackageÀ´×éÖ¯µÄ£¬¶ÔÓÚÿһ¸öclass¶¼ÓÐÏêϸµÄ½âÊÍ£¬ËüµÄ¼Ì³Ð¹Øϵ£¬ÊÇ·ñʵÏÖÁËij¸ö½Ó¿Ú£¬Í¨³£ÓÃÔÚÄÄÐ ......
package com.softeem.jbs.lesson4;
import java.util.Random;
/**
* ÅÅÐò²âÊÔÀà
*
* ÅÅÐòËã·¨µÄ·ÖÀàÈçÏ£º
* 1.²åÈëÅÅÐò£¨Ö±½Ó²åÈëÅÅÐò¡¢ÕÛ°ë²åÈëÅÅÐò¡¢Ï£¶ûÅÅÐò£©£»
* 2.½»»»ÅÅÐò£¨Ã°ÅÝÅÝÅÅÐò¡¢¿ìËÙÅÅÐò£©£»
* 3.Ñ¡ÔñÅÅÐò£¨Ö±½ÓÑ¡ÔñÅÅÐò¡¢¶ÑÅÅÐò£©£»
* 4.¹é²¢ÅÅÐò£»
* 5.»ùÊýÅÅÐò¡£
*
* ¹ØÓÚÅÅÐ ......
½ñÌìÔÚÑо¿ÏîÄ¿ÖеÄÉè¼Æ˼ÏëµÄʱºò£¬µÃ³öÒ»¸ö¶Ô½Ó¿ÚºÍ³éÏóÀà·Ç³£ÐÎÏóµÄÒ»¸ö±ÈÓ÷¡£
ËûÃǶ¼ÔÚ“½¨Öþ”ÖеÃÒÔÓ¦Ó㬽ӿھÍÏñ´óÂ¥µÄͼֽ£¬³éÏóÀà¾ÍÊÇ´óÂ¥µÄ¼Ü¹¹£¬Â¥²ã¾ÍÊÇÕæÕýµÄÀà¡£
ͼֻֽÊǹ滮³ö´óÂ¥µÄÑù×Ó£¬¹æ¶¨ÁËÒª×ö³ÉÉè¼ÆÑùʽ²ÅÄÜÕæÕý´òµ½Öî¶àЧ¹û£¬µ«ÊDz¢²»¹æ¶¨ÒªÈçºÎ¸Ç£¬¶ÔÂ¥²ãµÄÉè¼ÆÒ²²»¿¼ÂÇ£¬ÓÐÁËͼֽ£¬ ......
ÔÚ²âÊÔ
ConsoleRunner
µÄ¹ý³ÌÖз¢ÏÖÒ»¸öÓÐÒâ˼µÄÏÖÏó£¬Ò»¶ÎºÜ¼òµ¥µÄ
C
³ÌÐò£º
#include <stdio.h>
#include <windows.h>
int main() {
int i = 0;
for (;;) {
printf("%d\n", i++); ......