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

´«ÖDz¥¿Íjavaѧϰ 3g¿ª·¢Android2

½ñÌìÊÇѧϰAndroid¿ª·¢µÄµÚ¶þÌ죺
      
½ñÌìÖ÷ҪѧϰÁËÎļþµÄ¶ÁÈ¡¡¢ÒÔ¼°¶ÔxmlÎļþµÄ½âÎö£º
ʹÓÃÎļþ½øÐÐÊý¾Ý´æ´¢£º
ActivityÌṩÁËopenFileOutput()·½·¨¿ÉÒÔÓÃÓÚ°ÑÊý¾ÝÊä³öµ½ÎļþÖУ¬¾ßÌåµÄʵÏÖ¹ý³ÌÓëÔÚJ2SE»·¾³Öб£´æÊý¾Ýµ½ÎļþÖÐÊÇÒ»ÑùµÄ¡£
public class FileActivity extends Activity {
    @Override
public void onCreate(Bundle savedInstanceState) {
       
...
        
FileOutputStream outStream = this.openFileOutput("itcast.txt",
Context.MODE_PRIVATE);
        
outStream.write("´«ÖDz¥¿Í".getBytes());
        
outStream.close();  
    }
}
openFileOutput()·½·¨µÄµÚÒ»²ÎÊýÓÃÓÚÖ¸¶¨ÎļþÃû³Æ£¬²»ÄÜ°üº¬Â·¾¶·Ö¸ô·û“/” £¬Èç¹ûÎļþ²»´æÔÚ£¬Android
»á×Ô¶¯´´½¨Ëü¡£´´½¨µÄÎļþ±£´æÔÚ/data/data/<package
name>/filesĿ¼£¬È磺
/data/data/cn.itcast.action/files/itcast.txt
£¬Í¨¹ýµã»÷Eclipse²Ëµ¥“Window”-“Show
View”-“Other”£¬ÔÚ¶Ô»°´°¿ÚÖÐÕ¹¿ªandroidÎļþ¼Ð£¬Ñ¡ÔñÏÂÃæµÄFile ExplorerÊÓͼ£¬È»ºóÔÚFile
ExplorerÊÓͼÖÐÕ¹¿ª/data/data/<package
name>/filesĿ¼¾Í¿ÉÒÔ¿´µ½¸ÃÎļþ¡£
openFileOutput()·½·¨µÄµÚ¶þ²ÎÊýÓÃÓÚÖ¸¶¨²Ù×÷ģʽ£¬ÓÐËÄÖÖģʽ£¬·Ö±ðΪ£º
Context.MODE_PRIVATE   
=  0
Context.MODE_APPEND   
=  32768
Context.MODE_WORLD_READABLE =  1
Context.MODE_WORLD_WRITEABLE =  2
Context.MODE_PRIVATE
£º
ΪĬÈϲÙ×÷ģʽ£¬´ú±í¸ÃÎļþÊÇ˽ÓÐÊý¾Ý£¬Ö»Äܱ»Ó¦Óñ¾Éí·ÃÎÊ£¬ÔÚ¸ÃģʽÏ£¬Ð´ÈëµÄÄÚÈݻḲ¸ÇÔ­ÎļþµÄÄÚÈÝ£¬Èç¹ûÏë°ÑÐÂдÈëµÄÄÚÈÝ×·¼Óµ½Ô­ÎļþÖС£¿ÉÒÔʹÓÃContext.MODE_APPEND
Context.MODE_APPEND
£º
ģʽ»á¼ì²éÎļþÊÇ·ñ´æÔÚ£¬´æÔÚ¾ÍÍùÎļþ×·¼ÓÄÚÈÝ£¬·ñÔò¾Í´´½¨ÐÂÎļþ¡£
Context.MODE_WORLD_READABLEºÍContext.MODE_WORLD_WRITEABLEÓÃÀ´¿ØÖÆÆäËûÓ¦ÓÃÊÇ·ñÓÐȨÏÞ¶Áд¸ÃÎļþ¡£
MODE_WORLD_READABLE
£º±íʾµ±Ç°Îļþ¿ÉÒÔ±»ÆäËûÓ¦ÓöÁÈ¡£»MODE_WORLD_WRITEABLE
£º±íʾµ±Ç°Îļþ¿ÉÒÔ±»Æ


Ïà¹ØÎĵµ£º

javaÒì³£´¦Àí

Ö»Õë¶Ô²»Õý³£µÄÌõ¼þ²ÅʹÓÃÒì³£
Òì³£Ö»Ó¦¸Ã±»ÓÃÓÚ²»Õý³£µÄÌõ¼þ£¬ËüÃÇÓÀÔ¶²»Ó¦±»ÓÃÓÚÕý³£µÄ¿ØÖÆÁ÷¡£
ÏÂÃæÊÇÒ»¸öÓÃÒì³£×÷±éÀú½áÊøÌõ¼þµÄÀÄÓÃÒì³£µÄÀý×Ó£º
//horrible abuse of exceptions. Don't ever do this!
try{
int i=0;
while(true)a[i++].f();
}catch(ArrayIndexOutOfBoundsException e){ ......

Java³õѧÕ߶¼Ó¦¸Ã¸ã¶®µÄÁù¸öÎÊÌâ

¶ÔÓÚÕâ¸öϵÁÐÀïµÄÎÊÌ⣬ÿ¸öѧJavaµÄÈ˶¼Ó¦¸Ã¸ã¶®¡£µ±È»£¬Èç¹ûÖ»ÊÇѧJavaÍæÍæ¾ÍÎÞËùνÁË¡£Èç¹ûÄãÈÏΪ×Ô¼ºÒѾ­³¬Ô½³õѧÕßÁË£¬È´²»ºÜ¶®ÕâЩÎÊÌ⣬Ç뽫Äã×Ô¼ºÖعé³õѧÕßÐÐÁС£ÄÚÈݾùÀ´×ÔÓÚCSDNµÄ¾­µäÀÏÌù¡£
ÎÊÌâÒ»£ºÎÒÉùÃ÷ÁËʲô£¡
String s = "Hello world!";
¡¡Ðí¶àÈ˶¼×ö¹ýÕâÑùµÄÊÂÇ飬µ«ÊÇ£¬ÎÒÃǵ½µ×ÉùÃ÷ÁËʲô£¿»Ø´ðͨ ......

JavaÖеÄÅÅÐò±È½Ï·½Ê½£º×ÔÈ»ÅÅÐòºÍ±È½ÏÆ÷ÅÅÐò

¡¡¡¡ÕâÀïËù˵µ½µÄJavaÖеÄÅÅÐò²¢²»ÊÇÖ¸²åÈëÅÅÐò¡¢Ï£¶ûÅÅÐò¡¢¹é²¢ÅÅÐòµÈ¾ßÌåµÄÅÅÐòËã·¨¡£¶øÊÇÖ¸Ö´ÐÐÕâЩÅÅÐòË㷨ʱ£¬±È½ÏÁ½¸ö¶ÔÏó“´óС”µÄ±È½Ï²Ù×÷¡£ÎÒÃǺÜÈÝÒ×Àí½âÕûÐ굀 i>j ÕâÑùµÄ±È½Ï·½Ê½£¬µ«µ±ÎÒÃǶԶà¸ö¶ÔÏó½øÐÐÅÅÐòʱ£¬ÈçºÎ±È½ÏÁ½¸ö¶ÔÏóµÄ“´óС”ÄØ£¿ÕâÑùµÄ±È½Ï stu1 > stu2 ÏÔÈ»ÊDz»¿É ......

´«ÖDz¥¿Íjavaѧϰ ½ÌÓý°ì¹«ÏµÍ³2

½ñÌì¼ÌÐøÙ¡ÀÏʦµÄ½ÌÓý°ì¹«ÏµÍ³µÄÂọ́º
1. Ô±¹¤Â¼ÈëµÄ·þÎñÆ÷¶ËµÄ¼òµ¥ÑéÖ¤:
      
1). ʹÓà struts µÄ validator ¿ò¼Ü
      
2). ÑéÖ¤¹æÔòͬä¯ÀÀÆ÷¶ËµÄ jQuery µÄ validator ÑéÖ¤.
      
3). ÒÔ email ×Ö¶ÎΪÀý, ÑéÖ¤ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ