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

Java ¼Ì³ÐСÀý

¿´¿´ÏÂÃæ³ÌÐò½«Êä³öʲô½á¹û£º
/**
* ShowExtending
* ÑÝʾ¼Ì³ÐʱµÄÏÖÏó
*/
class SupCls {
static String s1 = "¸¸ÀàÀà±äÁ¿s1";
String s2 = "¸¸ÀàʵÀý±äÁ¿s2";
SupCls(){
System.out.println("¸¸À๹ÔìÆ÷±»·ÃÎÊ");
}
public static void f1(){
System.out.println("¸¸Àà static:f1() ±»·ÃÎÊ");
}
public void f2(){
System.out.println("¸¸Àà instance:f2() ±»·ÃÎÊ");
}
}
public class ShowExtending extends SupCls {
static String s1 = "×ÓÀàÀà±äÁ¿s1";
String s2 = "×ÓÀàʵÀý±äÁ¿s2";
ShowExtending(){
// ϵͳ»áµ÷Óø¸ÀàµÄĬÈÏ£¨Ã»ÓвÎÊý£©¹¹ÔìÆ÷
// Èç¹û¸¸ÀàĬÈϹ¹ÔìÆ÷±»¸²¸ÇÒÔÖÂûÓÐÎ޲ι¹ÔìÆ÷£¬Ôò±àÒë³ö´í
// ´ËʱӦ¸Ãµ÷Óà super( /*²ÎÊý*/ ); ÏÔʾµ÷Óø¸À๹ÔìÆ÷
System.out.println("×ÓÀ๹ÔìÆ÷±»·ÃÎÊ");
}
public static void f1(){
System.out.println("×ÓÀà static:f1() ±»·ÃÎÊ");
}
public void f2(){
System.out.println("×ÓÀà instance:f2() ±»·ÃÎÊ");
}
public static void main(String[] args) {
// ´´½¨×ÓÀà¶ÔÏóʱ»á´´½¨¸¸Àà¶ÔÏ󣬻áµ÷Óø¸À๹ÔìÆ÷
SupCls a = new SupCls();
ShowExtending b = new ShowExtending();
SupCls c = b;
// ²âÊÔͨ¹ý²»Í¬·½Ê½·ÃÎʸ¸ÀàºÍ×ÓÀàµÄÊý¾Ý³ÉÔ±
System.out.println("a.s1£º" + a.s1);
System.out.println("a.s2£º" + a.s2);
System.out.println("b.s1£º" + b.s1);
System.out.println("b.s2£º" + b.s2);
System.out.println("c.s1£º" + c.s1);
System.out.println("c.s2£º" + c.s2);
// ²âÊÔͨ¹ý²»Í¬·½Ê½·ÃÎʸ¸ÀàºÍ×ÓÀàµÄ·½·¨³ÉÔ±
System.out.print("a.f1():");
a.f1();
System.out.print("a.f2():");
a.f2();
System.out.print("b.f1():");
b.f1();
System.out.print("b.f2():");
b.f2();


Ïà¹ØÎĵµ£º

Java Scanner NoSuchElementException

½ñÌìͬѧÎÊÎÒÒ»¸öJavaÎÊÌ⣬´úÂë½á¹¹ÈçÏ£º
Scanner scan = new Scanner(System.in);
scan.next();
scan.close();
scan = new Scanner(System.in);
scan.next(); 
µ±³ÌÐòÔËÐе½µÚÎåÐÐÊÇ»áÅ׳öjava.util.NoSuchElementException
          at&nb ......

java±àÂëת»»

³£¼ûµÄJAVA³ÌÐò°üÀ¨ÒÔÏÂÀà±ð£º
*Ö±½ÓÔÚconsoleÉÏÔËÐеÄÀà(°üÀ¨¿ÉÊÓ»¯½çÃæµÄÀà)
*JSP´úÂëÀࣨע£ºJSPÊÇServletsÀàµÄ±äÐÍ£©
*ServeletsÀà
*EJBÀà
*ÆäËü²»¿ÉÒÔÖ±½ÓÔËÐеÄÖ§³ÖÀà
 
ÕâЩÀàÎļþÖУ¬¶¼ÓпÉÄܺ¬ÓÐÖÐÎÄ×Ö·û´®£¬²¢ÇÒ³£ÓÃǰÈýÀàJAVA³ÌÐòºÍÓû§Ö±½Ó½»»¥£¬ÓÃÓÚÊä³öºÍÊäÈë×Ö·û£¬È磺ÔÚJSPºÍServletÖеõ½¿Í»§ ......

Java Serializable£¨ÐòÁл¯£©µÄÀí½âºÍ×ܽá

1¡¢ÐòÁл¯ÊǸÉʲôµÄ£¿
       ¼òµ¥Ëµ¾ÍÊÇΪÁ˱£´æÔÚÄÚ´æÖеĸ÷ÖÖ¶ÔÏóµÄ״̬£¨Ò²¾ÍÊÇʵÀý±äÁ¿£¬²»ÊÇ·½·¨£©£¬²¢ÇÒ¿ÉÒ԰ѱ£´æµÄ¶ÔÏó״̬ÔÙ¶Á³öÀ´¡£ËäÈ»Äã¿ÉÒÔÓÃÄã×Ô¼ºµÄ¸÷ÖÖ¸÷ÑùµÄ·½·¨À´±£´æobject states£¬µ«ÊÇJava¸øÄãÌṩһÖÖÓ¦¸Ã±ÈÄã×Ô¼ººÃµÄ±£´æ¶ÔÏó״̬µÄ»úÖÆ£¬ÄǾÍÊÇÐòÁл¯¡£
2¡¢Ê²Ã´Çé¿öÏ ......

Lucene£º»ùÓÚJavaµÄÈ«ÎļìË÷ÒýÇæ¼ò½é


LuceneÊÇÒ»¸ö»ùÓÚJavaµÄÈ«ÎÄË÷Òý¹¤¾ß°ü¡£
»ùÓÚJavaµÄÈ«ÎÄË÷ÒýÒýÇæLucene¼ò½é£º¹ØÓÚ×÷ÕߺÍLuceneµÄÀúÊ·
È«ÎļìË÷µÄʵÏÖ£ºLueneÈ«ÎÄË÷ÒýºÍÊý¾Ý¿âË÷ÒýµÄ±È½Ï
ÖÐÎÄÇзִʻúÖÆ¼ò½é£º»ùÓÚ´Ê¿âºÍ×Ô¶¯ÇзִÊËã·¨µÄ±È½Ï
¾ßÌåµÄ°²×°ºÍʹÓüò½é£ºÏµÍ³½á¹¹½éÉܺÍÑÝʾ
Hacking Lucene£º¼ò»¯µÄ²éѯ·ÖÎöÆ÷£¬É¾³ýµÄʵÏÖ£¬¶¨ÖƵÄÅÅÐò£ ......

java ´°¿Ú¹Ø±ÕµÄÁùÖÖ·½·¨

1.ʹÓÃJFrameµÄenableEventsºÍprocessWindowEvent
//Frame1.java
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Frame1 extends JFrame {
  public Frame1() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    this.setSize(ne ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ