makefile Ö® java X Ö® lint
E:\>javac -X
-Xlint ÆôÓý¨ÒéµÄ¾¯¸æ
-Xlint:{all,deprecation,unchecked,fallthrough,path,serial,finally,-deprecat ion
,-unchecked,-fallthrough,-path,-serial,-finally}ÆôÓûò½ûÓÃÌض¨µÄ¾¯¸æ
-Xbootclasspath/p:<·¾¶> ÖÃÓÚÒýµ¼Àà·¾¶Ö®Ç°
-Xbootclasspath/a:<·¾¶> ÖÃÓÚÒýµ¼Àà·¾¶Ö®ºó
-Xbootclasspath:<·¾¶> ¸²¸ÇÒýµ¼ÀàÎļþµÄλÖÃ
-Djava.ext.dirs=<Ŀ¼> ¸²¸Ç°²×°µÄÀ©Õ¹Ä¿Â¼µÄλÖÃ
-Djava.endorsed.dirs=<Ŀ¼> ¸²¸ÇÇ©ÃûµÄ±ê׼·¾¶µÄλÖÃ
-Xmaxerrs <±àºÅ> ÉèÖÃÒªÊä³öµÄ´íÎóµÄ×î´óÊýÄ¿
-Xmaxwarns <±àºÅ> ÉèÖÃÒªÊä³öµÄ¾¯¸æµÄ×î´óÊýÄ¿
-Xstdout <ÎļþÃû> Öض¨Ïò±ê×¼Êä³ö
ÕâЩѡÏÊǷDZê׼ѡÏעÒâ¸üС£¡£¡£
ÎÒÃÇÒÀ´ÎÀ´¿´¿´ÆäÖÐÉæ¼° lint µÄÑ¡Ï
-Xlint
ÆôÓÃËùÓо¯¸æ¡£¸ÃÑ¡ÏîÏ൱ÓÚ -Xlint:all Ñ¡Ïî¡£Ïà·´£¬¹Ø±ÕËùÓо¯¸æµÄÑ¡ÏîΪ -Xlint:none¡£
-Xlint:unchecked
ÆôÓöÔËùνµÄδ¾¼ì²éµÄת»»£¨unchecked warning£©µÄ¾¯¸æ¡£Õâ¸ö¾¯¸æÉæ¼° JDK 5.0 ÖеÄÐÂÌØÐÔ——·¶ÐÍ£¨Generic
Type£©£¬Õâ¾ø¶ÔÊÇÁíÍâÒ»¸ö¹ÊÊÂÁË¡£ÓÐÐËȤµÄ»°£¬¿ÉÒÔÔÚ Internet ÉÏËÑË÷µ½ºÜ¶à¹ØÓÚ·¶Ð͵ÄÎÄÕ¡£
-Xlint:path
µ±·¢ÏÖ²»´æÔڵķ¾¶»òÕßĿ¼ʱ¸ø³ö¾¯¸æ£¬±ÈÈç±ê׼ѡÏîÖеÄÀà·¾¶£¨classpath£©£¬Ô´´úÂë·¾¶£¨sourcepath£©µÈµÈ¡£
-Xlint:serial
µ±ÔÚ¿ÉÐòÁл¯µÄÀàÖÐûÓз¢ÏÖ serialVersionUID µÄ¶¨Òåʱ£¬¸ø³ö¾¯¸æ¡£
Xlint:finally
µ±·¢ÏÖ finally ×Ó¾äÎÞ·¨Õý³£½áÊøµÄÇé¿öʱ¸ø³ö¾¯¸æ¡£±ÈÈçÏÂÃæÕâ¶Î´úÂ룺
try {
} catch (Exception e) {
} finally {
for (;;);
}
-Xlint:fallthrough
µ±ÔÚ switch Óï¾ä¿éÖз¢ÏÖ fall-through µÄÇéÐÎʱ¸ø³ö¾¯¸æ¡£ÕâÀïËù˵µÄ fall-through ÇéÐÎÖ¸µÄÊÇÔÚ
switchÓï¾ä
Ïà¹ØÎĵµ£º
1.JAVAÁ¬½ÓACCESSÊý¾Ý¿â
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url="jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ="+application.getRealPath("/Data/ReportDemo.mdb");
Connection conn = DriverManager.getConnection(url,"","");
ÔÚÉÏÃæµÄÁ¬½Ó·½·¨ÖУ¬ËùÉæ¼°µ½µÄ²ÎÊýº¬ÒåÈçÏÂËùʾ ......
Java´«µÝ²ÎÊýÓÐÁ½ÖÖ £ºÖµ´«µÝ£¬ÒýÓô«µÝ
Ò»°ãÒýÓÃÀàÐÍ ÊÇÒýÓô«µÝ£¬ÖµÀàÐÍÊÇÖµ´«µÝ
ÖµÀàÐÍÊÇÔʼÊý¾ÝÀàÐÍ °üÀ¨ int,byte,char short long,boolean,float,double
ÒýÓÃÀàÐ;ÍÊÇÒ»°ãµÄclassÀà µ±È»Ò²°üÀ¨ÔʼÊý¾ÝµÄ·â×°ÀàÐÍ ±ÈÈçintµÄ
·â×°ÀàÐÍΪInteger
Ò»°ãÇé¿öÏ£º
Öµ´«µÝ£º
Àý×Ó 1 public void show1(int str ......
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
try {
Class cls = com.lwf.util.CommonUtil.class;
Object obj = cls.newInstance();
Method addMethod = cls.ge ......
ÒªÀíÀà¼ÓÔØÌåϵ½á¹¹£¬¾Í±ØÐëÇå³þÈçϼ¸µã±È½Ï»ù±¾µÄÔÔò:
1. classLoaderÊÇÒ»ÖÖ¸¸×ÓÊ÷Ðνṹ£¨×¢£ºÕâÀï²»ÊÇÖ¸Àà¼Ì³ÐµÄ¸¸×Ó¹Øϵ£©
2. ¸¸classLoaderÎÞ·¨¿´µ½×ÓclassLoader¼ÓÔصÄÀà
3¡¢ÐéÄâ»ú×ñÊØË«Ç×ίÍмÓÔØÔÔò£¬¼´ÈκÎ×ÓclassLoaderÐëÊ×ÏÈίÍи¸classLoaderÏȼÓÔØÐèÒªµÄÀ࣬µ±¸¸classLoader¼ÓÔز»µ½Ê±ÔÙÓÉ×ÓclassLoa ......
±ÈÈçjavaÖг£ÓõÄÔËËã·û
Ò» ·ûºÅ++ ,+,--,-
ÓÐʱÕâ¸ö·ûºÅÆ´´ÕÆðÀ´Ò²Óе㸴ÔÓ
±ÈÈçÕâÑùÒ»¸öÔËËãʽ
int i=3;
i+++i-i++-++i
+ -ÔËËã·ûµÄÓÅÏȼ¶ µÍÓÚ++£¬-- ÏÈÔËËã++£¬--
¿ÉÒÔ½«ÉÏÃæµÄʽ×Ó²ð¿ª
i++ + i - i++ - ++i
ÕâÑùÊDz»ÊÇÈÝÒ׶àÁË
ÏÈÀ´¸ö¼òµ¥µãµÄ
1 K++
int k=0;
System.out.println(K++)
System.o ......