Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JAVA¹æ·¶Ñ§Ï°——static³ÉÔ±³õʼ»¯

class Super { static int taxi = 1729; }
class Sub extends Super {
static { System.out.print("Sub "); }
}
class Test {
public static void main(String[] args) {
System.out.println(Sub.taxi);
}
}
Êä³ö£º1729
֪ʶҪµã£º
A reference to a class field causes initialization of only the class or interface
that actually declares it, even though it might be referred to through the name of a
subclass, a subinterface, or a class that implements an interface.
Ò²¾ÍÊÇ˵ֻÓÐʹÓøÃÀà»òÕß½Ó¿ÚÖ±½Ó¶¨ÒåµÄÀà±äÁ¿£¬²Å»á¼¤·¢¸ÃÀàµÄ³õʼ»¯£»Èç¹ûʹÓõÄÊÇÆ丸ÀඨÒåµÄÀà±äÁ¿£¬Ôò×ÓÀ಻»á±»³õʼ»¯
interface I {
int i = 1, ii = Test.out("ii", 2);
}
interface J extends I {
int j = Test.out("j", 3), jj = Test.out("jj", 4);
}
interface K extends J {
int k = Test.out("k", 5);
}
class Test {
public static void main(String[] args) {
System.out.println(J.i);
System.out.println(K.j);
}
static int out(String s, int i) {
System.out.println(s + "=" + i);
return i;
}
}
Êä³ö£º
1
j=3
jj=4
3
 ÖªÊ¶Òªµã£º
Initialization of an interface does not, of itself, cause initialization of any of its
superinterfaces.
The reference to J.i is to a field that is a compile-time constant; therefore, it
does not cause I to be initialized. The reference to K.j is a reference to a field
actually declared in interface J that is not a compile-time constant; this causes initialization
of the fields of interface J, but not those of its superinterface I, nor
those of interface K. Despite the fact that the name K is used to refer to field j of
interface J, interface K is not initialized.


Ïà¹ØÎĵµ£º

Java 6 RowSet ʹÓÃÍêÈ«ÆÊÎö

Java 6 RowSet ʹÓÃÍêÈ«ÆÊÎö
C# ÌṩÁË DataSet£¬¿ÉÒÔ½«Êý¾ÝÔ´ÖеÄÊý¾Ý¶ÁÈ¡µ½ÄÚ´æÖУ¬½øÐÐÀëÏß²Ù×÷£¬È»ºóÔÙͬ²½µ½Êý¾ÝÔ´¡£Í¬Ñù£¬ÔÚ Java ÖÐÒ²ÌṩÁËÀàËƵÄʵÏÖ£¬¼´ RowSet¡£javax.sql.rowset °üÏ£¬¶¨ÒåÁËÎå¸ö²»Í¬µÄ RowSet ½Ó¿Ú£¬¹©²»Í¬µÄ³¡ºÏʹÓᣱ¾ÎĽ«·Ö±ð¶ÔÕâÎå¸ö RowSet µÄʹÓó¡ºÏÒÔ¼°Ï꾡Ó÷¨½øÐнéÉÜ£¬²¢ÇÒÃèÊöÊ ......

Javaµ÷ÓÃϵͳÃüÁîѧϰ£¨Èý£©

ѧϰÁËÁ½ÆªµÄRuntimeÀ࣬ÏÖÔÚ¶ÔËüÓÐÁ˸üÉîÒ»²ãµÄÁ˽⣬ÄÇôÎÒÃÇÀ´¿´¿´ÏÂÃæµÄ´úÂ룺
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader ;
import java.io.BufferedReader;
public class Exec_Output{
public static void main(String []args)throws IOException,Int ......

javaÃæÊÔÌâ¼°´ð°¸(»ù´¡Ìâ122µÀ£¬´úÂëÌâ19µÀ)

JAVAÏà¹Ø»ù´¡ÖªÊ¶
1¡¢ÃæÏò¶ÔÏóµÄÌØÕ÷ÓÐÄÄЩ·½Ãæ
1.³éÏó£º
³éÏó¾ÍÊǺöÂÔÒ»¸öÖ÷ÌâÖÐÓ뵱ǰĿ±êÎ޹صÄÄÇЩ·½Ã棬ÒÔ±ã¸ü³ä·ÖµØ×¢ÒâÓ뵱ǰĿ±êÓйصķ½Ãæ¡£³éÏó²¢²»´òËãÁ˽âÈ«²¿ÎÊÌ⣬¶øÖ»ÊÇÑ¡ÔñÆäÖеÄÒ»²¿·Ö£¬ÔÝʱ²»Óò¿·Öϸ½Ú¡£³éÏó°üÀ¨Á½¸ö·½Ã棬һÊǹý³Ì³éÏ󣬶þÊÇÊý¾Ý³éÏó¡£
2.¼Ì³Ð£º
¼Ì³ÐÊÇÒ»ÖÖÁª½áÀàµÄ²ã´ÎÄ£ÐÍ£¬²¢ ......

Delphiʱ¼äºÍJavaʱ¼äµÄת»»Àà¡£

ÕâÑùÒ»À´£¬DelphiʹÓÃWebserviceºÍJAVAͨѶʱ£¬¿ÉÒÔ½«DELPHIµÄʱ¼äÖ±½Ó´«¸øJAVA¡£´Ó¶øÃâÈ¥ÁËʱ¼ä×Ö·û´®parseÖ®¼äµÄÏûºÄ£¬Ìá¸ßµÄ³ÌÐòЧÂÊ¡£
Delphiʱ¼äʵÖʾÍÊÇdoubleÀàÐÍ£¬ÕûÊý²¿·Ö±íʾÌ죬СÊý²¿·Ö±íʾµ±Ììʱ¼ä£¬Ã¿ºÁÃëΪ1/86400000¡£¿¼Âǵ½Ê±ÇøµÄת»»ºó£¬JAVAºÍDELPHIʱ¼äÖ®¼äµÄת»»ÀàÈçÏ£º
import java.util.Calendar ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ