Java¾²Ì¬³õʼ»¯£¬ÊµÀý³õʼ»¯ÒÔ¼°¹¹Ôì·½·¨
Ê×ÏÈÓÐÈý¸ö¸ÅÄîÐèÒªÁ˽⣺
Ò»£®¾²Ì¬³õʼ»¯£ºÊÇÖ¸Ö´Ðо²Ì¬³õʼ»¯¿éÀïÃæµÄÄÚÈÝ¡£
¶þ£®ÊµÀý³õʼ»¯£ºÊÇÖ¸Ö´ÐÐʵÀý³õʼ»¯¿éÀïÃæµÄÄÚÈÝ¡£
Èý£®¹¹Ôì·½·¨£ºÒ»¸öÃû³Æ¸úÀàµÄÃû³ÆÒ»ÑùµÄ·½·¨£¬ÌØÊâÔÚÓÚ²»´ø·µ»ØÖµ¡£
¶ÔÓÚÕâÈý¸ö¸ÅÄ¸ø³öÒÔϳÌÐò£¬·½±ãÀí½â£º
Java´úÂë
class Book{
public static int booksum=0;//¾²Ì¬±äÁ¿
static{//ÕâÊǾ²Ì¬³õʼ»¯¿é
print();
System.out.println("this is static block");
}
{//ʵÀý³õʼ»¯¿é
System.out.println(booksum);
}
public Book(){//¹¹Ôì·½·¨
System.out.println("this is Book's constructor~");
booksum+=1;
}
public static void print(){//¾²Ì¬·½·¨
System.out.println("this is static method~");
}
}
ÎÒ½ö´Ó´úÂëÖ´ÐеĽǶÈÀ´Ì½ÌÖJava¼ÓÔØÀà¡¢´´½¨¶ÔÏóµÄ¹ý³Ì£¬²¢Ã»ÓÐÉîÈëµ½JVMµÄ»úÖÆÖÐÈ¥£¬Òò´Ë²»±£Ö¤JVMÊÇÕâÑùµÄÒ»¸ö¹ý³Ì£¬µ«ÎÒÈÏΪÈç¹û½öÏë¶ÔJavaµÄ´úÂëÖ´Ðйý³ÌÓиöÁ˽⣬ÎÒÏÂÃæµÄ·ÖÎö¾Í×ã¹»ÁË¡£
1£®Ò»¸ö¶ÔÏóµÚÒ»´Î±»´´½¨Ê±£¬ÏÈÒª¼ÓÔظöÔÏóËùÊôµÄÀ࣬¼´¶ÔÓ¦µÄ.class
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
Java·ÃÎÊȨÏÞÒ»¹²ÓÐËÄÖÖ£¬ËûÃÇÖ®¼äµÄ·ÃÎÊȨÏޱȽÏͨ¹ýÒÔÏÂÒ»×éÀý×ÓÀ´½âÊÍ
Àý×Ócode£ºModiferDemo.java
package com.glust.blog.j2se;
public class ModiferDemo{
//ËÄÖÖ·ÃÎÊȨÏ޵ıäÁ¿£¨ÊôÐÔ£©
private int a;
int b;//friendly
protected int c;
public int d;
......
ÔÚʵ¼ÊÓ¦ÓÃÖУ¬¿ÉÄÜ»áÅöµ½ÕâÑùµÄÇé¿ö£¬ÐèÒªÔÚJava´úÂëÖÐÖ´ÐÐJavaScript¡£
ÀýÈç:
import java.io.IOException;
import java.io.PrintWriter;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public cl ......
package dtm.tools;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.Socket;
import java.net.UnknownHostException;
import java.util.Calendar;
import java.util.Dat ......
1, ±£Ö¤Ḭ̈߳²È«µÄÈýÖÖ·½·¨:
a, ²»Òª¿çÏ̷߳ÃÎʹ²Ïí±äÁ¿
b, ʹ¹²Ïí±äÁ¿ÊÇfinalÀàÐ͵Ä
c, ½«¹²Ïí±äÁ¿µÄ²Ù×÷¼ÓÉÏͬ²½
2, Ò»¿ªÊ¼¾Í½«ÀàÉè¼Æ³ÉḬ̈߳²È«µÄ, ±ÈÔÚºóÆÚÖØÐÂÐÞ¸´Ëü,¸üÈÝÒ×.
3, ±àд¶àÏ̳߳ÌÐò, Ê×Ïȱ£Ö¤ËüÊÇÕýÈ·µÄ, Æä´ÎÔÙ¿¼ÂÇÐÔÄÜ.
4, ÎÞ×´Ì ......