»ù´¡ JAVA³ÌÐò
1.±à³Ì½ç×îÖøÃûµÄÒ»¾ä»°“Hello world!”,ÈκÎÒ»¸ö³ÌÐòÔ±Æð²½Ê±±ØÓöµÄÓï¾ä
public class HelloWorld {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.print("Hello World!");
}
}
2.¸ù¾ÝÌáʾÊäÈëÁ½¸öÕûÊý£¬Êä³öÕûÊýµÄºÍ£¬×î»ù´¡µÄ³ÌÐò£¬³õѧÕßÐ趮µÃScannerµÄÓ÷¨
import java.util.Scanner;
public class AddTwoInteger {
public static void main(String[] args) {
// TODO Auto-generated method stub
int integer1;
int integer2;
int sum;
Scanner input=new Scanner(System.in);
System.out.print("Enter first integer:");
integer1=input.nextInt();
System.out.print("Enter second integer:");
integer2=input.nextInt();
sum=integer1+integer2;
System.out.printf("%d",sum);
}
}
3.ÅжϴóСµÄ³ÌÐò£¬Õâ¸ö³ÌÐòҲûɶ¿É˵µÄ£¬Î¨Ò»ÌáÐѵÄÊÇ£ºÔÚÅжϴóСµÄʱºò£¨ÏàµÈµÄÇé¿ö£©²»Òª°Ñ“==“´íд³É=£¬ÕâÊÇ×î³£¼ûµÄ´íÎó¡£
import java.util.Scanner;
public class Comparision {
public static void main(String[] args) {
// TODO Auto-generated method stub
int integer1;
int integer2;
Scanner input=new Scanner(System.in);
System.out.print("Enter first integer:");
integer1=input.nextInt();
System.out.print("Enter second integer:");
integer2=input.nextInt();
if(integer1>integer2) &nb
Ïà¹ØÎĵµ£º
·½·¨µÄÖØÔØ
£ºÍ¬Ò»¸öÀàÀïÃæ·½·¨µÄÃû×ÖÏàͬ£¬·½·¨µÄ²ÎÊýÏÖ÷ÒªÊDzÎÊýÀàÐÍ£¬²ÎÊý¸öÊý£©
²»Í¬
,
·µ»ØÀàÐÍ¿ÉÄܲ»Í¬¡£
ÖØÔØ·½·¨¿ÉÒÔ¾ßÓв»Í¬µÄ·µ»ØÀàÐÍ£¬µ«·µ»ØÀàÐͱ¾Éí²»×ãÒÔÇø·Ö·½·¨µÄÁ½¸ö°æ
±¾¡£ ......
´óѧµÄʱºòÑ¡ÐÞ¹ýÒ»¸öѧÆÚÈÕÓµ±Ê±ÈÕÓïÀÏʦ¶ÔÎÒÃÇ˵£º“¶ÔÓÚÖйúÈËÀ´½²£¬Ñ§Ï°Ó¢ÓïÒ»°ãÊÇ¿Þ׎øÈ¥£¬Ð¦×ųöÀ´£»Ñ§Ï°ÈÕÓïÔòÊÇЦ׎øÈ¥£¬¿Þ×ųöÀ´”¡£Òâ˼¾ÍÊÇ˵ѧϰӢÓïµÄʱºò£¬ÈëÃŵÄʱºò±È½ÏÀ§ÄÑ£¬µ«ÊÇÖ»Òª¼á³ÖѧÏÂÈ¥£¬×ª±äÁ˺ºÓïµÄ˼άϰ¹ßʱ£¬×î½ü¿ÉÒÔ°ÑÓ¢ÓïѧµÃºÜºÃ¡£¶øÈÕÓﲻͬ£¬Ò»·½ÃæÒòΪÆäÓ뺺ÓïµÄ½ôÃÜ¹Ø ......
µÚÒ»£¬Ì¸Ì¸final, finally, finalizeµÄÇø±ð¡£
¡¡¡¡µÚ¶þ£¬Anonymous Inner Class (ÄäÃûÄÚ²¿Àà) ÊÇ·ñ¿ÉÒÔextends(¼Ì³Ð)ÆäËüÀ࣬ÊÇ·ñ¿ÉÒÔimplements(ʵÏÖ)interface(½Ó¿Ú)?
¡¡¡¡µÚÈý£¬Static Nested Class ºÍ Inner ClassµÄ²»Í¬£¬ËµµÃÔ½¶àÔ½ºÃ(ÃæÊÔÌâÓеĺÜÁýͳ)¡£
¡¡¡¡µÚËÄ£ ......
±³¾°¼ò½é£ºKMPËã·¨ÓÃÀ´´¦Àí×Ö·û´®Æ¥ÅäµÄ¡£¸øÄãA,BÁ½¸ö×Ö·û´®£¬¼ì²éB´®ÊÇ·ñÊÇA´®µÄ×Ó´®£¬ÀàËÆÓÚJavaµÄString.indexOf("")¡£Ö®ËùÒÔ½Ð×öKMP£¬ÊÇÒòΪÕâ¸öËã·¨ÊÇÓÉKnuth¡¢Morris¡¢PrattÈý¸öÌá³öÀ´µÄ£¬È¡ÁËÕâÈý¸öÈ˵ÄÃû×ÖµÄÍ·Ò»¸ö×Öĸ¡£
ÔÀí½éÉÜ£ºÕÒµ½Æ¥Åäʧ°ÜʱµÄ×îºÏÊʵĻØÍËλÖ㬶ø²»ÊǼòµ¥µÄ»ØÍ˵½×Ó´®µÄµÚÒ»¸ö×Ö·û£¨³£¹ ......
³£¼ûµÄJAVA³ÌÐò°üÀ¨ÒÔÏÂÀà±ð£º
*Ö±½ÓÔÚconsoleÉÏÔËÐеÄÀà(°üÀ¨¿ÉÊÓ»¯½çÃæµÄÀà)
*JSP´úÂëÀࣨע£ºJSPÊÇServletsÀàµÄ±äÐÍ£©
*ServeletsÀà
*EJBÀà
*ÆäËü²»¿ÉÒÔÖ±½ÓÔËÐеÄÖ§³ÖÀà
ÕâЩÀàÎļþÖУ¬¶¼ÓпÉÄܺ¬ÓÐÖÐÎÄ×Ö·û´®£¬²¢ÇÒ³£ÓÃÇ°ÈýÀàJAVA³ÌÐòºÍÓû§Ö±½Ó½»»¥£¬ÓÃÓÚÊä³öºÍÊäÈë×Ö·û£¬È磺ÔÚJSPºÍServletÖеõ½¿Í»§ ......