this ÓësuperÔÚjavaÖÐÔËÓÃÕûºÏ
A.ʹÓùؼü×ÖthisµÄ×¼Ôò£º
1.ÔÚ¹¹ÔìÆ÷ÖУ¬Èç¹ûҪʹÓùؼü×Öthis,ÄÇô£¬±ØÐë·ÅÔÚµÚÒ»ÐУ¬·ñÔò½«µ¼ÖÂÒ»¸ö±àÒë´íÎó¡£
2.¹¹Ôì·½·¨ÒýÓÃthisÖ¸ÏòÕýÔÚÖ´Ðз½·¨µÄÀàµÄʵÀý¡£¾²Ì¬·½·¨²»ÄÜʹÓÃthis¹Ø¼ü×Ö£¬ÒòΪ¾²Ì¬·½·¨²»ÊôÓÚÀàµÄʵÀý£¬ËùÒÔthisÒ²¾ÍûÓÐʲô¶«Î÷È¥Ö¸Ïò¡£¹¹ÔìÆ÷µÄthisÖ¸Ïòͬһ¸öÀàÖУ¬²»Í¬²ÎÊýÁбíµÄÁíÍâÒ»¸ö¹¹ÔìÆ÷£¬ÎÒÃÇ¿´¿´ÏÂÃæµÄ´úÂ룺
public class Platypus {
String name;
Platypus(String input) {
name = input;
}
Platypus() {
this("John/Mary Doe");
}
public static void main(String args[]) {
Platypus p1 = new Platypus("digger");
Platypus p2 = new Platypus();
}
}
ÔÚÉÏÃæµÄ´úÂëÖУ¬ÓÐ2¸ö²»Í¬²ÎÊýÁбíµÄ¹¹ÔìÆ÷¡£µÚÒ»¸ö¹¹ÔìÆ÷£¬¸øÀàµÄ³ÉÔ±name¸³Öµ£¬µÚ¶þ¸ö¹¹ÔìÆ÷£¬µ÷ÓõÚÒ»¸ö¹¹ÔìÆ÷£¬¸ø³ÉÔ±±äÁ¿nameÒ»¸ö³õʼֵ "John/Mary Doe".
×¢Ò⣺¾¡¹Ü¿ÉÒÔÓÃthisµ÷ÓÃÒ»¸ö¹¹ÔìÆ÷£¬µ«È´²»Äܵ÷ÓÃÁ½¸ö¡£´ËÍ⣬±ØÐ뽫¹¹ÔìÆ÷µ÷ÓÃÖÃÓÚ×îÆðʼλÖ㬷ñÔò±àÒë»á³ö´í¡£
B.ʹÓÃsuperʱµÄ×¼Ôò£º
1.¹¹ÔìÆ÷ʹÓÃsuperÈ¥µ÷Óó¬ÀàÖеĹ¹ÔìÆ÷¡£¶øÇÒÕâÐдúÂë±ØÐë·ÅÔÚµÚÒ»ÐУ¬·ñÔò±àÒ뽫³ö´í¡£
2.ÎÞÂÛ¹¹ÔìÆ÷ºÍ·½·¨£¬¶¼Óùؼü×ÖsuperÖ¸Ïò³¬À࣬µ«ÊÇÓõķ½·¨²»Ò»Ñù¡£·½·¨ÓÃÕâ¸ö¹Ø¼ü×ÖÈ¥Ö´Ðб»ÖØÔصij¬ÀàÖеķ½·¨¡£
class Mammal1{
void getBirthInfo() {
System.out.println("born alive.");
}
}
class Platypus2 extends Mammal {
void getBirthInfo() {
System.out.println("hatch from eggs");
System.out.print("a mammal normally is ");
super.getBirthInfo();
}
}
public class TestMammal{
public static void main(String[] args){
Platypus2 pl = new Platypus2();
}
}
ÈýÖÖÇé¿ö˵Ã÷£º
1¡¢¸¸ÀàÖÐûÓÐÏÔʽ¶¨ÒåÈκι¹Ôì·½·¨£¬´Ëʱ¸¸ÀàÖÐʵ¼ÊÓÐÒ»¸öĬÈϵÄÎÞ²ÎÊý¹¹Ôì·½·¨¡£Õâʱ£¬ÔÚ×ÓÀàÖÐÏÔʽ¶¨ÒåÈκι¹Ô
Ïà¹ØÎĵµ£º
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......
1¡¢ÀàÐÍÄ£°å Class£º
ÎïÒÔÀà¾Û£º
ÎÒÃÇ¿ÉÒÔÓÃclass Person{ } class Animal{ }À´ÃèÊöÒ»ÀàÈË»òÒ»ÀදÎ
ÄÇôÔÙÏëһϣ¬ÎÒÃÇÊDz»ÊÇ¿ÉÒÔÓÃclass Class{ } À´³éÏóÃèÊöÀàÄØ£¿
´ð°¸Ê±¿ÉÒԵģ¬Õâ¾ÍÊÇjdkÖÐµÄ Class ÀࣨÀàÐ ......
×î½üѧϰjavaÓõ½ÁËJList,¶ÔÓÚÏòJListÖÐÌí¼ÓÊý¾Ý£¬À§ÈÅÁ˺þã¬ÉÏÍø²é¸øµÄ´ð°¸¶¼Ã»¸öºÏÊʵģ¬ÎÊÁËÀÏʦ²ÅŪÃ÷°×Щ£¬×ܽáÈçÏ£º
1.ʹÓÃVector£ºÊ×ÏÈ°ÑÄãµÄÊý¾ÝÏ´æ·ÅÔÚVectorÖУ¬È»ºóµ÷ÓÃJListµÄsetListData()·½·¨£¬½«VectorÌí¼Óµ½JListÖÐ
Vector vt=new Vector();
JList list=new JLis ......
Groovy supports a few neat ways to work with SQL more easily and to make SQL more Groovy. You can perform queries and SQL statements, passing in variables easily with proper handling of statements, connections and exception handling thanks to closures.
import groovy.sql.Sql
def foo = 'cheese ......