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

JAVA¾­µä»ù´¡ÎÊÌâÖ® ³éÏóÀàÓë½Ó¿Ú

Ò»¡¢³éÏóÀà×¢ÒâÊÂÏ
1£¬³éÏóÀàÖпÉÒÔÓÃ0+¸ö³éÏó·½·¨¡£
2£¬ÓгéÏó·½·¨µÄµÄÀà±ØÐëÊdzéÏóÀà¡£
3£¬³éÏóÀàÅÉÉúµÄ·Ç³éÏó×ÓÀà±ØÐëʵÏÖ³éÏóÀàÖж¨ÒåµÄËùÓгéÏó·½·¨¡£
4£¬³éÏóÀ಻ÄÜ´´½¨¶ÔÏó¡£
5£¬abstract ²»ÄÜÓëfinal²¢ÁÐÐÞÊÎͬһ¸öÀà
6£¬abstract²»ÄÜÓëprivate,static ,final,native²¢ÁÐÐÞÊÎͬһ·½·¨¡£
package com.wensefu.abstrator;
public abstract class AbParent {

protected int b;
public int c;
int d;
/*
* ³éÏóÀà¿ÉÒÔÓзdzéÏó·½·¨
*/
public void unabstract(){
System.out.println("parent unabstract");
}

/*
* ÓÉÓÚ×ÓÀà±ØÐëʵÏÖ³éÏó¸¸ÀàµÄ³éÏó·½·¨£¬¹Ê
* abstract ²»¿ÉÓëprivate,static,final,native²¢ÁÐÐÞÊÎͬһ¸ö·½·¨
* ³éÏóÀà·½·¨Ä¬ÈÏÐÞÊηûΪfriendly,¼´°ü¿É¼û
*/
//private abstract void abstr(); !error
public abstract void abstr();


}
package com.wensefu.abstrator.extend;
import com.wensefu.abstrator.AbParent;
public class AbChildExtend extends AbParent {
@Override
public void abstr() {
// TODO Auto-generated method stub
System.out.println("child abstr");
}

public static void main(String[] args) {

AbChildExtend a=new AbChildExtend();

a.b=1;
a.c=2;
a.abstr();
a.unabstract();
}
}
package com.wensefu.abstrator;
public abstract class Child extends AbParent {
public abstract void abstr();
public static void main(String[] args) {
System.out.println("³éÏóÀàµÄ³éÏó×ÓÀà¿ÉÒÔ²»ÊµÏÖ¸¸ÀàÖеijéÏó·½·¨");
}
}
¶þ¡¢½Ó¿Ú¡£
1£¬½Ó¿ÚµÄÐÞÊηûÓÐÁ½ÖÖ£ºpublic ºÍĬÈÏ¡£
2£¬½Ó¿ÚÖз½·¨µÄĬÈÏÐÞÊηûΪpublic abstract,½Ó¿ÚÖз½·¨µÄ·½·¨Ìå¿ÉÒÔÓÉjava±àд£¬Ò²¿ÉÓÉÆäËûÓïÑÔ±àд£¬ÓÉÆäËûÓïÑÔ±à дʱ£¬·½·¨ÐèÓÉnativeÐÞÊΡ£
3£¬½Ó¿ÚÖж¨ÒåµÄÊý¾Ý³ÉԱȫÊÇfinal static ,¼´³£Á¿¡£
4£¬½Ó¿ÚÖз½·¨È«Îª³éÏó·½·¨¡£
5£¬½Ó¿ÚÒà¾ßÓм̳ÐÐÔ£¬¿ÉÒÔͨ¹ýextendsÉùÃ÷¸Ã½Ó¿ÚµÄ¸¸½Ó¿Ú¡£
6£¬Èç¹ûʵÏָýӿڵÄÀ಻ÊdzéÏóÀ࣬Ôò¸ÃÀà±ØÐëʵÏÖ½Ó¿ÚµÄËùÓгéÏó·½·¨¡£ÇÒÓ¦¾ßÓÐÍêÈ«ÏàͬµÄ·µ»ØÖµºÍ²ÎÊýÁÐ±í¡£
7£¬ÈôʵÏÖij½Ó¿ÚµÄÀàΪ³éÏóÀ࣬Ôò¿ÉÒÔ²»ÊµÏָýӿڵÄËùÓз½·¨¡£
8£¬½Ó¿ÚµÄ³éÏó·½·¨¶¼ÒѾ­Ö¸¶¨Îªpublic ,ËùÒÔÀàÔÚʵÏÖ·½·¨Ê±£¬±ØÐëÏÔʽµØÊ¹


Ïà¹ØÎĵµ£º

¡¶Java³ÌÐòÔ±ÉϰàÄǵãʶù¡·×ܽá

ÒÔǰ¿´¹ýÕâ±¾Ê飬×î½ü¾õµÃ×÷ÕßÓÐЩ¹Ûµã»¹ÊÇͦ¶ÔÁË£¬¼ÓÉÏЩ×Ô¼ºµÄ×ܽᣬÕûÀíÏ£¬Ï£ÍûÄܶÔÒÔºó¹¤×÷ѧϰÓÐÖ¸µ¼×÷Óá£
³ÌÐòÔ±µÄÈýÖÖ¾³½ç£º
 
¿ÉÄÜÍõ¹úά´ó¸ç¿´¿´ºóÈ˰ÑËûµÄÈËÉúÈý¾³½ç·¢Õ¹µÃÈçºÎ¿çѧ¿Æ£¬¶àÃÅÀ࣬һ¶¨ÈªÏÂÓÐÖª£¬±¶¸ÐÐÀο°¡£¬¹þ¹þ£¡
1¡¢³ÌÐòÔ±µÚÒ»²ã¾³½ç£ºÕâ°ï¸çÃÇÒ»°ã¶¼ÊDZÏÒµÈýÄêÒÔÄڵģ¬±È½ÏÓо«Á¦£¬¶ ......

ÍøÉÏÕÒÁ˸öjavaËæ»úÉú³ÉÃÜÂëµÄ¡£¡£¡£·¢ÉÏÀ´¼Ç¼һÏ¡£

import java.util.Random;
public class test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println(genRandomNum(10));
}
/**
* Éú³ÉËæ¼´ÃÜÂë
* @param pwd_len Éú³ÉµÄÃÜÂëµÄ×ܳ¤¶È
* @return ÃÜÂëµÄ×Ö·û´®
*/
p ......

javaµÄ¶àÏß³Ìͬ²½»¥³â:synchronizedµÄÂÒÓÃ

ÔÚjavaµÄ¶àÏß³Ìͬ²½»¥³â´¦ÀíÖÐ,synchronizedÊDZ𲻿ÉÉٵĶ«Î÷.
µ«ÊÇÈç¹û²»ÇåÎúµÄ±à³ÌµÄ»°,Ò²¾ÍÊÇÂÒÓÃsynchronizedµÄ»°,ËÀËøµÄ·¢Éú¾ÍÊÇÀëÄãºÜ½üµÄ»°ÌâÁË.
ÔÚÇ°ÃæµÄÒ»¸öά»¤Öоͷ¢ÏÖÒ»¸öËÀËøµÄbug.¾¿ÆäÔ­ÒòÊÇ¿ª·¢ÕßûÓÐÕæÕýÃ÷°×¶àÏ̵߳Äͬ²½»¥³â,ûÓÐÒâʶµ½ËÀËøµÄ·¢Éú,»òÕß˵×Ô¼ºÈÏΪдµÄ´úÂë²»»á·¢ÉúËÀËø.
ËÀËøµÄ·¢ÉúÒ»°ã ......

javaÉú³Éuuid

UUID(Universally Unique Identifier)È«¾ÖΨһ±êʶ·û,ÊÇÖ¸ÔÚһ̨»úÆ÷ÉÏÉú³ÉµÄÊý×Ö£¬Ëü±£Ö¤¶ÔÔÚͬһʱ¿ÕÖеÄËùÓлúÆ÷¶¼ÊÇΨһµÄ¡£°´ÕÕ¿ª·ÅÈí¼þ»ù½ð»á(OSF)ÖÆ¶¨µÄ±ê×¼¼ÆË㣬Óõ½ÁËÒÔÌ«Íø¿¨µØÖ·¡¢ÄÉÃ뼶ʱ¼ä¡¢Ð¾Æ¬IDÂëºÍÐí¶à¿ÉÄܵÄÊý×Ö¡£ÓÉÒÔϼ¸²¿·ÖµÄ×éºÏ£ºµ±Ç°ÈÕÆÚºÍʱ¼ä(UUIDµÄµÚÒ»¸ö²¿·ÖÓëʱ¼äÓйأ¬Èç¹ûÄãÔÚÉú ......

java²¥·ÅwavµÄ»ù´¡´úÂë

import java.io.*;
public class TestMusic{
 
 private AudioFormat format;
    private byte[] samples;
 
 public static void main(String args[])throws Exception{
  TestMusic sound =new TestMusic("1.wav");
  InputStream stream =new ByteArrayInputStre ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ