??xml version="1.0" encoding="utf-8" standalone="yes"?>日本福利片在线,亚洲一区二区三区四区五区午夜,99国产精品久久久久久久 http://www.aygfsteel.com/rorely/category/41144.html学习zh-cnTue, 02 Feb 2010 14:56:40 GMTTue, 02 Feb 2010 14:56:40 GMT60java实现U瑟夫环问题http://www.aygfsteel.com/rorely/archive/2010/01/15/309732.html期待明天期待明天Fri, 15 Jan 2010 15:45:00 GMThttp://www.aygfsteel.com/rorely/archive/2010/01/15/309732.htmlhttp://www.aygfsteel.com/rorely/comments/309732.htmlhttp://www.aygfsteel.com/rorely/archive/2010/01/15/309732.html#Feedback0http://www.aygfsteel.com/rorely/comments/commentRss/309732.htmlhttp://www.aygfsteel.com/rorely/services/trackbacks/309732.html
import java.util.Scanner;
/**
*使用数组实现U瑟夫环问题
*由m个h围成一个首q的圈报数?br /> *从第一个h开始,?开始报敎ͼ报到n的h出圈Q?br /> *剩下的hl箋?开始报敎ͼ直到所有的人都出圈为止?br /> *对于l定的m和nQ求出所有h的出圈顺?
*/
public class RingTest{
    
public static void main(String[] args){
        System.out.println(
"E序说明如下Q?/span>");
        System.out.println(
"由m个h围成一个首q的圈报数。从W一个h开始,?开始报敎ͼ报到n的h出圈Q剩下的人l从1开始报敎ͼ直到所有的人都出圈为止。对于给定的m和nQ求出所有h的出圈顺?");
        
        
//提示输入Mh?/span>
        System.out.println("误入做q个游戏的Mh敎ͼ");
        Scanner sca
=new Scanner(System.in);
        
int m=sca.nextInt();
        
//提示输入要出圈的数?/span>
        System.out.println("误入要出圈的数|");        
        
int n=sca.nextInt();
        System.out.println(
"按出圈的ơ序输出序号Q?/span>");        
        
//创徏有m个值的数组
        int[] a=new int[m];
        
//初始长度Q以后出圈一个,长度减一
        int len=m;
        
//l数l赋?/span>
        for(int i=0;i<a.length;i++)
            a[i]
=i+1;
        
//i为元素下表,j代表当前要报的数
        int i=0;
        
int j=1;
        
while(len>0){
            
if(a[i%m]>0){
                
if(j%n==0){//扑ֈ要出圈的人,q把圈中人数减一
                    System.out.print(a[i%m]+"  ");
                    a[i
%m]=-1;
                    j
=1;
                    i
++;
                    len
--;
                }
else{
                    i
++;
                    j
++;
                }
            }
else{//遇到IZ了,pC一位,但j不加一Q也是q个位置没有报数
                i++;
            }
        }
    }
}



期待明天 2010-01-15 23:45 发表评论
]]>
单例模式实现方式有两U?/title><link>http://www.aygfsteel.com/rorely/archive/2010/01/15/309714.html</link><dc:creator>期待明天</dc:creator><author>期待明天</author><pubDate>Fri, 15 Jan 2010 13:58:00 GMT</pubDate><guid>http://www.aygfsteel.com/rorely/archive/2010/01/15/309714.html</guid><wfw:comment>http://www.aygfsteel.com/rorely/comments/309714.html</wfw:comment><comments>http://www.aygfsteel.com/rorely/archive/2010/01/15/309714.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rorely/comments/commentRss/309714.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rorely/services/trackbacks/309714.html</trackback:ping><description><![CDATA[<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #008000;">/**</span><span style="color: #008000;"><br /> *单例模式主要作用是在java应用E序中,一个类只有一个实例存在?br /> </span><span style="color: #008000;">*/</span><span style="color: #000000;"><br /> <br /> </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">class</span><span style="color: #000000;"> Singleton{<br />     </span><span style="color: #0000ff;">private</span><span style="color: #000000;"> Singleton(){    <br />     }<br />     </span><span style="color: #0000ff;">private</span><span style="color: #000000;"> </span><span style="color: #0000ff;">final</span><span style="color: #000000;"> </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> Singleton instance</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> Singleton();<br />     </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> Singleton getInstance(){<br />         </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> instance;<br />     }<br /> }<br /> <br /> <br /> 或者如?br /> <br /> </span> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #008000;">/**</span><span style="color: #008000;"><br /> *单例模式主要作用是在java应用E序中,一个类只有一个实例存在。The Second Way<br /> </span><span style="color: #008000;">*/</span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">class</span><span style="color: #000000;"> Singleton{<br />     </span><span style="color: #0000ff;">private</span><span style="color: #000000;"> </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> Singleton instance</span><span style="color: #000000;">=</span><span style="color: #0000ff;">null</span><span style="color: #000000;">;<br />     </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> </span><span style="color: #0000ff;">synchronized</span><span style="color: #000000;"> Singleton getInstance(){<br />         </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(instance</span><span style="color: #000000;">==</span><span style="color: #0000ff;">null</span><span style="color: #000000;">) instance</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> Singleton();<br />         </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> instance;<br />     }<br /> }</span></div> <br /> </div> <img src ="http://www.aygfsteel.com/rorely/aggbug/309714.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rorely/" target="_blank">期待明天</a> 2010-01-15 21:58 <a href="http://www.aygfsteel.com/rorely/archive/2010/01/15/309714.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>java多线E编E测?/title><link>http://www.aygfsteel.com/rorely/archive/2010/01/15/309712.html</link><dc:creator>期待明天</dc:creator><author>期待明天</author><pubDate>Fri, 15 Jan 2010 13:49:00 GMT</pubDate><guid>http://www.aygfsteel.com/rorely/archive/2010/01/15/309712.html</guid><wfw:comment>http://www.aygfsteel.com/rorely/comments/309712.html</wfw:comment><comments>http://www.aygfsteel.com/rorely/archive/2010/01/15/309712.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rorely/comments/commentRss/309712.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rorely/services/trackbacks/309712.html</trackback:ping><description><![CDATA[设计4个线E,其中两个U程每次对j?Q另外两个线E对j每次??br /> <br /> <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #008000;">/**</span><span style="color: #008000;"><br /> *Java multithread Test<br /> *Date:2010-1-15<br /> *Author:<br /> </span><span style="color: #008000;">*/</span><span style="color: #000000;"><br /> <br /> </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">class</span><span style="color: #000000;"> MultithreadTest{<br />     </span><span style="color: #0000ff;">private</span><span style="color: #000000;"> </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> j;<br /> <br />     </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> </span><span style="color: #0000ff;">void</span><span style="color: #000000;"> main(String[] args){<br />         MultithreadTest mt</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> MultithreadTest();<br />         Inc inc</span><span style="color: #000000;">=</span><span style="color: #000000;">mt.</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> Inc();<br />         Dec dec</span><span style="color: #000000;">=</span><span style="color: #000000;">mt.</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> Dec();<br />         </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;i</span><span style="color: #000000;"><</span><span style="color: #000000;">2</span><span style="color: #000000;">;i</span><span style="color: #000000;">++</span><span style="color: #000000;">){<br />             Thread t</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> Thread(inc);<br />             t.start();<br />             t</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> Thread(dec);<br />             t.start();<br />         }<br />     }<br /> <br />     </span><span style="color: #0000ff;">private</span><span style="color: #000000;"> </span><span style="color: #0000ff;">synchronized</span><span style="color: #000000;"> </span><span style="color: #0000ff;">void</span><span style="color: #000000;"> inc(){<br />         j</span><span style="color: #000000;">++</span><span style="color: #000000;">;<br />         System.out.println(Thread.currentThread().getName()</span><span style="color: #000000;">+</span><span style="color: #000000;">"</span><span style="color: #000000;">-inc:</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">j);<br />     }<br />     </span><span style="color: #0000ff;">private</span><span style="color: #000000;"> </span><span style="color: #0000ff;">synchronized</span><span style="color: #000000;"> </span><span style="color: #0000ff;">void</span><span style="color: #000000;"> dec(){<br />         j</span><span style="color: #000000;">--</span><span style="color: #000000;">;<br />         System.out.println(Thread.currentThread().getName()</span><span style="color: #000000;">+</span><span style="color: #000000;">"</span><span style="color: #000000;">-Dec:</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">j);<br />     }<br /> <br /> <br />     </span><span style="color: #0000ff;">class</span><span style="color: #000000;"> Inc </span><span style="color: #0000ff;">implements</span><span style="color: #000000;"> Runnable{<br />         </span><span style="color: #0000ff;">public</span><span style="color: #000000;">  </span><span style="color: #0000ff;">void</span><span style="color: #000000;"> run(){<br />             </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;i</span><span style="color: #000000;"><</span><span style="color: #000000;">100</span><span style="color: #000000;">;i</span><span style="color: #000000;">++</span><span style="color: #000000;">){<br />                 inc();<br />             }<br />         }<br />     }<br /> <br />     </span><span style="color: #0000ff;">class</span><span style="color: #000000;"> Dec </span><span style="color: #0000ff;">implements</span><span style="color: #000000;"> Runnable{<br />         </span><span style="color: #0000ff;">public</span><span style="color: #000000;">  </span><span style="color: #0000ff;">void</span><span style="color: #000000;"> run(){<br />             </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;i</span><span style="color: #000000;"><</span><span style="color: #000000;">100</span><span style="color: #000000;">;i</span><span style="color: #000000;">++</span><span style="color: #000000;">){<br />                 dec();<br />             }<br />         }<br />     }<br /> }</span></div> <br /> l果如下Q?br /> Thread-2-inc:77<br /> Thread-2-inc:78<br /> Thread-2-inc:79<br /> Thread-2-inc:80<br /> Thread-2-inc:81<br /> Thread-2-inc:82<br /> Thread-2-inc:83<br /> Thread-2-inc:84<br /> Thread-2-inc:85<br /> Thread-2-inc:86<br /> Thread-2-inc:87<br /> Thread-2-inc:88<br /> Thread-2-inc:89<br /> Thread-2-inc:90<br /> Thread-2-inc:91<br /> Thread-2-inc:92<br /> Thread-2-inc:93<br /> Thread-2-inc:94<br /> Thread-2-inc:95<br /> Thread-3-Dec:94<br /> Thread-3-Dec:93<br /> Thread-3-Dec:92<br /> Thread-3-Dec:91<br /> Thread-3-Dec:90<br /> Thread-3-Dec:89<br /> Thread-3-Dec:88<br /> Thread-3-Dec:87<br /> Thread-3-Dec:86<br /> Thread-3-Dec:85<br /> Thread-3-Dec:84<br /> Thread-3-Dec:83<br /> Thread-3-Dec:82<br /> Thread-3-Dec:81<br /> Thread-3-Dec:80<br /> Thread-3-Dec:79<br /> Thread-3-Dec:78<br /> Thread-3-Dec:77<br /> Thread-3-Dec:76<br /> Thread-3-Dec:75<br /> Thread-3-Dec:74<br /> Thread-3-Dec:73<br /> Thread-3-Dec:72<br /> Thread-3-Dec:71<br /> Thread-3-Dec:70<br /> Thread-3-Dec:69<br /> Thread-3-Dec:68<br /> Thread-3-Dec:67<br /> Thread-3-Dec:66<br /> Thread-3-Dec:65<br /> Thread-3-Dec:64<br /> Thread-3-Dec:63<br /> Thread-3-Dec:62<br /> Thread-3-Dec:61<br /> Thread-3-Dec:60<br /> Thread-3-Dec:59<br /> Thread-3-Dec:58<br /> Thread-3-Dec:57<br /> Thread-3-Dec:56<br /> Thread-3-Dec:55<br /> Thread-3-Dec:54<br /> Thread-3-Dec:53<br /> Thread-3-Dec:52<br /> Thread-3-Dec:51<br /> Thread-3-Dec:50<br /> Thread-3-Dec:49<br /> Thread-3-Dec:48<br /> Thread-3-Dec:47<br /> Thread-3-Dec:46<br /> Thread-3-Dec:45<br /> Thread-3-Dec:44<br /> Thread-3-Dec:43<br /> Thread-3-Dec:42<br /> Thread-3-Dec:41<br /> Thread-3-Dec:40<br /> Thread-3-Dec:39<br /> Thread-3-Dec:38<br /> Thread-3-Dec:37<br /> Thread-3-Dec:36<br /> Thread-3-Dec:35<br /> Thread-3-Dec:34<br /> Thread-3-Dec:33<br /> Thread-3-Dec:32<br /> Thread-3-Dec:31<br /> Thread-3-Dec:30<br /> Thread-3-Dec:29<br /> Thread-3-Dec:28<br /> Thread-3-Dec:27<br /> Thread-3-Dec:26<br /> Thread-3-Dec:25<br /> Thread-3-Dec:24<br /> Thread-3-Dec:23<br /> Thread-3-Dec:22<br /> Thread-3-Dec:21<br /> Thread-3-Dec:20<br /> Thread-3-Dec:19<br /> Thread-3-Dec:18<br /> Thread-3-Dec:17<br /> Thread-3-Dec:16<br /> Thread-3-Dec:15<br /> Thread-3-Dec:14<br /> Thread-3-Dec:13<br /> Thread-3-Dec:12<br /> Thread-3-Dec:11<br /> Thread-3-Dec:10<br /> Thread-3-Dec:9<br /> Thread-3-Dec:8<br /> Thread-3-Dec:7<br /> Thread-3-Dec:6<br /> Thread-3-Dec:5<br /> Thread-3-Dec:4<br /> Thread-3-Dec:3<br /> Thread-3-Dec:2<br /> Thread-3-Dec:1<br /> Thread-3-Dec:0<br /> Thread-3-Dec:-1<br /> Thread-3-Dec:-2<br /> Thread-3-Dec:-3<br /> Thread-3-Dec:-4<br /> Thread-3-Dec:-5<br /> Thread-2-inc:-4<br /> Thread-2-inc:-3<br /> Thread-2-inc:-2<br /> Thread-2-inc:-1<br /> Thread-2-inc:0<br /> Thread-2-inc:1<br /> Thread-2-inc:2<br /> Thread-2-inc:3<br /> Thread-2-inc:4<br /> Thread-2-inc:5<br /> Thread-2-inc:6<br /> Thread-1-Dec:5<br /> Thread-1-Dec:4<br /> Thread-1-Dec:3<br /> Thread-1-Dec:2<br /> Thread-1-Dec:1<br /> Thread-1-Dec:0<br /> Thread-1-Dec:-1<br /> Thread-1-Dec:-2<br /> Thread-0-inc:-1<br /> Thread-0-inc:0<br /> Thread-0-inc:1<br /> Thread-0-inc:2<br /> Thread-0-inc:3<br /> Thread-0-inc:4<br /> Thread-0-inc:5<br /> Thread-0-inc:6<br /> Thread-0-inc:7<br /> Thread-0-inc:8<br /> Thread-0-inc:9<br /> Thread-0-inc:10<br /> Thread-0-inc:11<br /> Thread-0-inc:12<br /> Thread-1-Dec:11<br /> Thread-1-Dec:10<br /> Thread-1-Dec:9<br /> Thread-1-Dec:8<br /> Thread-1-Dec:7<br /> Thread-1-Dec:6<br /> Thread-1-Dec:5<br /> Thread-1-Dec:4<br /> Thread-1-Dec:3<br /> Thread-1-Dec:2<br /> Thread-1-Dec:1<br /> Thread-1-Dec:0<br /> Thread-1-Dec:-1<br /> Thread-1-Dec:-2<br /> Thread-1-Dec:-3<br /> Thread-1-Dec:-4<br /> Thread-1-Dec:-5<br /> Thread-1-Dec:-6<br /> Thread-1-Dec:-7<br /> Thread-1-Dec:-8<br /> Thread-1-Dec:-9<br /> Thread-1-Dec:-10<br /> Thread-1-Dec:-11<br /> Thread-1-Dec:-12<br /> Thread-1-Dec:-13<br /> Thread-1-Dec:-14<br /> Thread-1-Dec:-15<br /> Thread-1-Dec:-16<br /> Thread-1-Dec:-17<br /> Thread-1-Dec:-18<br /> Thread-1-Dec:-19<br /> Thread-1-Dec:-20<br /> Thread-1-Dec:-21<br /> Thread-2-inc:-20<br /> Thread-2-inc:-19<br /> Thread-2-inc:-18<br /> Thread-2-inc:-17<br /> Thread-2-inc:-16<br /> Thread-2-inc:-15<br /> Thread-2-inc:-14<br /> Thread-2-inc:-13<br /> Thread-2-inc:-12<br /> Thread-2-inc:-11<br /> Thread-2-inc:-10<br /> Thread-1-Dec:-11<br /> Thread-1-Dec:-12<br /> Thread-1-Dec:-13<br /> Thread-1-Dec:-14<br /> Thread-1-Dec:-15<br /> Thread-1-Dec:-16<br /> Thread-1-Dec:-17<br /> Thread-1-Dec:-18<br /> Thread-1-Dec:-19<br /> Thread-1-Dec:-20<br /> Thread-1-Dec:-21<br /> Thread-1-Dec:-22<br /> Thread-1-Dec:-23<br /> Thread-0-inc:-22<br /> Thread-0-inc:-21<br /> Thread-0-inc:-20<br /> Thread-0-inc:-19<br /> Thread-0-inc:-18<br /> Thread-0-inc:-17<br /> Thread-0-inc:-16<br /> Thread-1-Dec:-17<br /> Thread-1-Dec:-18<br /> Thread-1-Dec:-19<br /> Thread-1-Dec:-20<br /> Thread-1-Dec:-21<br /> Thread-1-Dec:-22<br /> Thread-1-Dec:-23<br /> Thread-1-Dec:-24<br /> Thread-1-Dec:-25<br /> Thread-1-Dec:-26<br /> Thread-1-Dec:-27<br /> Thread-1-Dec:-28<br /> Thread-2-inc:-27<br /> Thread-2-inc:-26<br /> Thread-2-inc:-25<br /> Thread-2-inc:-24<br /> Thread-2-inc:-23<br /> Thread-2-inc:-22<br /> Thread-1-Dec:-23<br /> Thread-1-Dec:-24<br /> Thread-1-Dec:-25<br /> Thread-1-Dec:-26<br /> Thread-1-Dec:-27<br /> Thread-1-Dec:-28<br /> Thread-2-inc:-27<br /> Thread-2-inc:-26<br /> Thread-2-inc:-25<br /> Thread-2-inc:-24<br /> Thread-2-inc:-23<br /> Thread-2-inc:-22<br /> Thread-2-inc:-21<br /> Thread-2-inc:-20<br /> Thread-2-inc:-19<br /> Thread-2-inc:-18<br /> Thread-2-inc:-17<br /> Thread-2-inc:-16<br /> Thread-2-inc:-15<br /> Thread-2-inc:-14<br /> Thread-2-inc:-13<br /> Thread-2-inc:-12<br /> Thread-2-inc:-11<br /> Thread-2-inc:-10<br /> Thread-2-inc:-9<br /> Thread-2-inc:-8<br /> Thread-2-inc:-7<br /> Thread-2-inc:-6<br /> Thread-2-inc:-5<br /> Thread-2-inc:-4<br /> Thread-2-inc:-3<br /> Thread-2-inc:-2<br /> Thread-2-inc:-1<br /> Thread-2-inc:0<br /> Thread-2-inc:1<br /> Thread-2-inc:2<br /> Thread-2-inc:3<br /> Thread-2-inc:4<br /> Thread-2-inc:5<br /> Thread-2-inc:6<br /> Thread-2-inc:7<br /> Thread-2-inc:8<br /> Thread-2-inc:9<br /> Thread-2-inc:10<br /> Thread-2-inc:11<br /> Thread-2-inc:12<br /> Thread-2-inc:13<br /> Thread-2-inc:14<br /> Thread-2-inc:15<br /> Thread-1-Dec:14<br /> Thread-1-Dec:13<br /> Thread-1-Dec:12<br /> Thread-1-Dec:11<br /> Thread-1-Dec:10<br /> Thread-1-Dec:9<br /> Thread-1-Dec:8<br /> Thread-1-Dec:7<br /> Thread-1-Dec:6<br /> Thread-1-Dec:5<br /> Thread-1-Dec:4<br /> Thread-1-Dec:3<br /> Thread-1-Dec:2<br /> Thread-1-Dec:1<br /> Thread-1-Dec:0<br /> <br /> <br /> <br /> <img src ="http://www.aygfsteel.com/rorely/aggbug/309712.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rorely/" target="_blank">期待明天</a> 2010-01-15 21:49 <a href="http://www.aygfsteel.com/rorely/archive/2010/01/15/309712.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>汉诺?/title><link>http://www.aygfsteel.com/rorely/archive/2009/11/23/303403.html</link><dc:creator>期待明天</dc:creator><author>期待明天</author><pubDate>Mon, 23 Nov 2009 15:30:00 GMT</pubDate><guid>http://www.aygfsteel.com/rorely/archive/2009/11/23/303403.html</guid><wfw:comment>http://www.aygfsteel.com/rorely/comments/303403.html</wfw:comment><comments>http://www.aygfsteel.com/rorely/archive/2009/11/23/303403.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rorely/comments/commentRss/303403.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rorely/services/trackbacks/303403.html</trackback:ping><description><![CDATA[<font style="background-color: #cce8cf"> <p> </p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img id="Codehighlighter1_18_495_Open_Image" onclick="this.style.display='none'; Codehighlighter1_18_495_Open_Text.style.display='none'; Codehighlighter1_18_495_Closed_Image.style.display='inline'; Codehighlighter1_18_495_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_18_495_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_18_495_Closed_Text.style.display='none'; Codehighlighter1_18_495_Open_Image.style.display='inline'; Codehighlighter1_18_495_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> Hanoi</span><span id="Codehighlighter1_18_495_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_18_495_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> i</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;<br /> <img id="Codehighlighter1_84_186_Open_Image" onclick="this.style.display='none'; Codehighlighter1_84_186_Open_Text.style.display='none'; Codehighlighter1_84_186_Closed_Image.style.display='inline'; Codehighlighter1_84_186_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_84_186_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_84_186_Closed_Text.style.display='none'; Codehighlighter1_84_186_Open_Image.style.display='inline'; Codehighlighter1_84_186_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args)</span><span id="Codehighlighter1_84_186_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_84_186_Open_Text"><span style="color: #000000">{            <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">Ud的步骤如下:</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        hanoi(</span><span style="color: #000000">5</span><span style="color: #000000">,</span><span style="color: #000000">'</span><span style="color: #000000">A</span><span style="color: #000000">'</span><span style="color: #000000">,</span><span style="color: #000000">'</span><span style="color: #000000">B</span><span style="color: #000000">'</span><span style="color: #000000">,</span><span style="color: #000000">'</span><span style="color: #000000">C</span><span style="color: #000000">'</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">\nUd的次Cؓ:</span><span style="color: #000000">"</span><span style="color: #000000">+</span><span style="color: #000000">i);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_227_309_Open_Image" onclick="this.style.display='none'; Codehighlighter1_227_309_Open_Text.style.display='none'; Codehighlighter1_227_309_Closed_Image.style.display='inline'; Codehighlighter1_227_309_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_227_309_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_227_309_Closed_Text.style.display='none'; Codehighlighter1_227_309_Open_Image.style.display='inline'; Codehighlighter1_227_309_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> move(</span><span style="color: #0000ff">char</span><span style="color: #000000"> x,</span><span style="color: #0000ff">char</span><span style="color: #000000"> y)</span><span id="Codehighlighter1_227_309_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_227_309_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.print(x</span><span style="color: #000000">+</span><span style="color: #000000">"</span><span style="color: #000000">---></span><span style="color: #000000">"</span><span style="color: #000000">+</span><span style="color: #000000">y</span><span style="color: #000000">+</span><span style="color: #000000">"</span><span style="color: #000000">   </span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        i</span><span style="color: #000000">++</span><span style="color: #000000">;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">if</span><span style="color: #000000">(i</span><span style="color: #000000">%</span><span style="color: #000000">5</span><span style="color: #000000">==</span><span style="color: #000000">0</span><span style="color: #000000">)System.out.println();<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_372_493_Open_Image" onclick="this.style.display='none'; Codehighlighter1_372_493_Open_Text.style.display='none'; Codehighlighter1_372_493_Closed_Image.style.display='inline'; Codehighlighter1_372_493_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_372_493_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_372_493_Closed_Text.style.display='none'; Codehighlighter1_372_493_Open_Image.style.display='inline'; Codehighlighter1_372_493_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> hanoi(</span><span style="color: #0000ff">int</span><span style="color: #000000"> n,</span><span style="color: #0000ff">char</span><span style="color: #000000"> one,</span><span style="color: #0000ff">char</span><span style="color: #000000"> two,</span><span style="color: #0000ff">char</span><span style="color: #000000"> three)</span><span id="Codehighlighter1_372_493_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_372_493_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">if</span><span style="color: #000000">(n</span><span style="color: #000000">==</span><span style="color: #000000">1</span><span style="color: #000000">) move(one,three);<br /> <img id="Codehighlighter1_408_490_Open_Image" onclick="this.style.display='none'; Codehighlighter1_408_490_Open_Text.style.display='none'; Codehighlighter1_408_490_Closed_Image.style.display='inline'; Codehighlighter1_408_490_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_408_490_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_408_490_Closed_Text.style.display='none'; Codehighlighter1_408_490_Open_Image.style.display='inline'; Codehighlighter1_408_490_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">else</span><span id="Codehighlighter1_408_490_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_408_490_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            hanoi(n</span><span style="color: #000000">-</span><span style="color: #000000">1</span><span style="color: #000000">,one,three,two);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            move(one,three);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            hanoi(n</span><span style="color: #000000">-</span><span style="color: #000000">1</span><span style="color: #000000">,two,one,three);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span></div> <p><br /> <br /> <br /> Ud的步骤如下:<br /> A--->C   A--->B   C--->B   A--->C   B--->A<br /> B--->C   A--->C   A--->B   C--->B   C--->A<br /> B--->A   C--->B   A--->C   A--->B   C--->B<br /> A--->C   B--->A   B--->C   A--->C   B--->A<br /> C--->B   C--->A   B--->A   B--->C   A--->C<br /> A--->B   C--->B   A--->C   B--->A   B--->C<br /> A--->C<br /> Ud的次Cؓ:31</p> <p></font> </p> <img src ="http://www.aygfsteel.com/rorely/aggbug/303403.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rorely/" target="_blank">期待明天</a> 2009-11-23 23:30 <a href="http://www.aygfsteel.com/rorely/archive/2009/11/23/303403.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>最大公U数最公倍数http://www.aygfsteel.com/rorely/archive/2009/11/23/303400.html期待明天期待明天Mon, 23 Nov 2009 15:10:00 GMThttp://www.aygfsteel.com/rorely/archive/2009/11/23/303400.htmlhttp://www.aygfsteel.com/rorely/comments/303400.htmlhttp://www.aygfsteel.com/rorely/archive/2009/11/23/303400.html#Feedback0http://www.aygfsteel.com/rorely/comments/commentRss/303400.htmlhttp://www.aygfsteel.com/rorely/services/trackbacks/303400.htmlpublic class GcdAndLcm{
    
public static void main(String[] args){    
        
int[] result=gAndL(56,48);
        System.out.println(
"最大公U数为:"+result[0]+"  最公倍数为:"+result[1]);
    }

    
public static int[] gAndL(int x,int y){
        
int[] gl=new int[2];
        
int m,n,t;
        m
=x;n=y;
        
if(x<y){
            n
=x;
            m
=y;
        }

        
while(m%n!=0){
            t
=n;
            n
=m%n;
            m
=t;
        }
        
        gl[
0]=n;
        gl[
1]=x*y/n;
        
return gl;
    }

}
l果Q?br /> 最大公U数Q? 最公倍数Q?36

期待明天 2009-11-23 23:10 发表评论
]]>
java实现九九乘法?/title><link>http://www.aygfsteel.com/rorely/archive/2009/11/23/303399.html</link><dc:creator>期待明天</dc:creator><author>期待明天</author><pubDate>Mon, 23 Nov 2009 15:09:00 GMT</pubDate><guid>http://www.aygfsteel.com/rorely/archive/2009/11/23/303399.html</guid><wfw:comment>http://www.aygfsteel.com/rorely/comments/303399.html</wfw:comment><comments>http://www.aygfsteel.com/rorely/archive/2009/11/23/303399.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rorely/comments/commentRss/303399.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rorely/services/trackbacks/303399.html</trackback:ping><description><![CDATA[<p> </p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img id="Codehighlighter1_37_266_Open_Image" onclick="this.style.display='none'; Codehighlighter1_37_266_Open_Text.style.display='none'; Codehighlighter1_37_266_Closed_Image.style.display='inline'; Codehighlighter1_37_266_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_37_266_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_37_266_Closed_Text.style.display='none'; Codehighlighter1_37_266_Open_Image.style.display='inline'; Codehighlighter1_37_266_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> NineByNineMultiplication</span><span id="Codehighlighter1_37_266_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_37_266_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_81_264_Open_Image" onclick="this.style.display='none'; Codehighlighter1_81_264_Open_Text.style.display='none'; Codehighlighter1_81_264_Closed_Image.style.display='inline'; Codehighlighter1_81_264_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_81_264_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_81_264_Closed_Text.style.display='none'; Codehighlighter1_81_264_Open_Image.style.display='inline'; Codehighlighter1_81_264_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args)</span><span id="Codehighlighter1_81_264_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_81_264_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_112_258_Open_Image" onclick="this.style.display='none'; Codehighlighter1_112_258_Open_Text.style.display='none'; Codehighlighter1_112_258_Closed_Image.style.display='inline'; Codehighlighter1_112_258_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_112_258_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_112_258_Closed_Text.style.display='none'; Codehighlighter1_112_258_Open_Image.style.display='inline'; Codehighlighter1_112_258_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000"> i</span><span style="color: #000000">=</span><span style="color: #000000">1</span><span style="color: #000000">;i</span><span style="color: #000000"><=</span><span style="color: #000000">9</span><span style="color: #000000">;i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span id="Codehighlighter1_112_258_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_112_258_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_147_218_Open_Image" onclick="this.style.display='none'; Codehighlighter1_147_218_Open_Text.style.display='none'; Codehighlighter1_147_218_Closed_Image.style.display='inline'; Codehighlighter1_147_218_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_147_218_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_147_218_Closed_Text.style.display='none'; Codehighlighter1_147_218_Open_Image.style.display='inline'; Codehighlighter1_147_218_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />            </span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000"> j</span><span style="color: #000000">=</span><span style="color: #000000">1</span><span style="color: #000000">;j</span><span style="color: #000000"><=</span><span style="color: #000000">i;j</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span id="Codehighlighter1_147_218_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_147_218_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />                System.out.print(j</span><span style="color: #000000">+</span><span style="color: #000000">"</span><span style="color: #000000">*</span><span style="color: #000000">"</span><span style="color: #000000">+</span><span style="color: #000000">i</span><span style="color: #000000">+</span><span style="color: #000000">"</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">+</span><span style="color: #000000">i</span><span style="color: #000000">*</span><span style="color: #000000">j</span><span style="color: #000000">+</span><span style="color: #000000">"</span><span style="color: #000000">\t</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />            }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println();<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span></div> <br /> the result is as follows.<br /> <font style="background-color: #cce8cf"> <p><br /> <br /> 1*1=1<br /> 1*2=2   2*2=4<br /> 1*3=3   2*3=6   3*3=9<br /> 1*4=4   2*4=8   3*4=12  4*4=16<br /> 1*5=5   2*5=10  3*5=15  4*5=20  5*5=25<br /> 1*6=6   2*6=12  3*6=18  4*6=24  5*6=30  6*6=36<br /> 1*7=7   2*7=14  3*7=21  4*7=28  5*7=35  6*7=42  7*7=49<br /> 1*8=8   2*8=16  3*8=24  4*8=32  5*8=40  6*8=48  7*8=56  8*8=64<br /> 1*9=9   2*9=18  3*9=27  4*9=36  5*9=45  6*9=54  7*9=63  8*9=72  9*9=81</p> <p></font> </p> <img src ="http://www.aygfsteel.com/rorely/aggbug/303399.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rorely/" target="_blank">期待明天</a> 2009-11-23 23:09 <a href="http://www.aygfsteel.com/rorely/archive/2009/11/23/303399.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>猴子吃桃问题--Java~程解决http://www.aygfsteel.com/rorely/archive/2009/11/22/303268.html期待明天期待明天Sun, 22 Nov 2009 15:04:00 GMThttp://www.aygfsteel.com/rorely/archive/2009/11/22/303268.htmlhttp://www.aygfsteel.com/rorely/comments/303268.htmlhttp://www.aygfsteel.com/rorely/archive/2009/11/22/303268.html#Feedback0http://www.aygfsteel.com/rorely/comments/commentRss/303268.htmlhttp://www.aygfsteel.com/rorely/services/trackbacks/303268.html猴子吃桃问题Q?br /> 猴子吃桃子问题:猴子W一天摘下N个桃子,当时吃了一半,q不q瘾Q就又吃了一个。第二天又将剩下的桃子吃掉一半,又多吃了一个。以后每天都吃前一天剩下的一半零一个。到W?0天在惛_的时候就剩一个桃子了,求第一天共摘下来多个桃子Q?/font>
public class MonkeyEatsPeach{
    
public static void main(String[] args){
        
int initialNum=1;    
        System.out.println(initialNum);
        
for(int i=1;i<10;i++){
            initialNum
=(initialNum+1)*2;
            System.out.println(initialNum);                            
        }

        System.out.println(
"the initial number of peachs is:"+initialNum);
    }

}
最l的l果Q?br />


G:\Code\java>java MonkeyEatsPeach
1
4
10
22
46
94
190
382
766
1534
the initial number of peachs is:1534

 



期待明天 2009-11-22 23:04 发表评论
]]>
JFrame 做一个简易的验证?/title><link>http://www.aygfsteel.com/rorely/archive/2009/11/02/300773.html</link><dc:creator>期待明天</dc:creator><author>期待明天</author><pubDate>Mon, 02 Nov 2009 10:30:00 GMT</pubDate><guid>http://www.aygfsteel.com/rorely/archive/2009/11/02/300773.html</guid><wfw:comment>http://www.aygfsteel.com/rorely/comments/300773.html</wfw:comment><comments>http://www.aygfsteel.com/rorely/archive/2009/11/02/300773.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rorely/comments/commentRss/300773.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rorely/services/trackbacks/300773.html</trackback:ping><description><![CDATA[<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000ff;">import</span><span style="color: #000000;"> javax.swing.</span><span style="color: #000000;">*</span><span style="color: #000000;">;<br /> </span><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.awt.</span><span style="color: #000000;">*</span><span style="color: #000000;">;<br /> </span><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.awt.event.</span><span style="color: #000000;">*</span><span style="color: #000000;">;<br /> </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">class</span><span style="color: #000000;"> ValidationCode </span><span style="color: #0000ff;">extends</span><span style="color: #000000;"> JFrame </span><span style="color: #0000ff;">implements</span><span style="color: #000000;"> ActionListener{<br />     </span><span style="color: #0000ff;">private</span><span style="color: #000000;"> JButton productBtn;<br />     </span><span style="color: #0000ff;">private</span><span style="color: #000000;"> JPanel downPanel;    <br />     </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> ValidationCode(){<br />         productBtn</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> JButton(</span><span style="color: #000000;">"</span><span style="color: #000000;">New Code</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br />         productBtn.addActionListener(</span><span style="color: #0000ff;">this</span><span style="color: #000000;">);<br />         productBtn.setSize(</span><span style="color: #000000;">50</span><span style="color: #000000;">,</span><span style="color: #000000;">50</span><span style="color: #000000;">);        <br />         downPanel</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> JPanel();            <br />         downPanel.add(productBtn);        <br />         </span><span style="color: #0000ff;">this</span><span style="color: #000000;">.setTitle(</span><span style="color: #000000;">"</span><span style="color: #000000;">Validation Code</span><span style="color: #000000;">"</span><span style="color: #000000;">);        <br />         </span><span style="color: #0000ff;">this</span><span style="color: #000000;">.add(downPanel);    <br />     }<br />     </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">void</span><span style="color: #000000;"> actionPerformed(ActionEvent e){        <br />         </span><span style="color: #0000ff;">this</span><span style="color: #000000;">.repaint();<br />     }<br />     </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">void</span><span style="color: #000000;"> paint(Graphics g){        <br />         </span><span style="color: #0000ff;">super</span><span style="color: #000000;">.paint(g);<br />         String code</span><span style="color: #000000;">=</span><span style="color: #000000;">""</span><span style="color: #000000;">;<br />         </span><span style="color: #0000ff;">char</span><span style="color: #000000;">[] characters</span><span style="color: #000000;">=</span><span style="color: #000000;">{</span><span style="color: #000000;">'</span><span style="color: #000000;">A</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">B</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">C</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">D</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">E</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">F</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">G</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">H</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">I</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">J</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">K</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">L</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">M</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">N</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">O</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">P</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">Q</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">R</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">S</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">T</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">U</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">V</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">W</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">X</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">Y</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">Z</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">a</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">b</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">c</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">d</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">e</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">f</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">g</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">h</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">i</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">j</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">k</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">l</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">m</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">n</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">o</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">p</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">q</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">r</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">s</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">t</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">u</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">v</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">w</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">x</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">y</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">z</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">1</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">2</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">3</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">4</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">5</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">6</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">7</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">8</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">9</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">0</span><span style="color: #000000;">'</span><span style="color: #000000;">};<br />         </span><span style="color: #0000ff;">char</span><span style="color: #000000;">[] fourResult</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> </span><span style="color: #0000ff;">char</span><span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">];<br />         </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> index;<br />         </span><span style="color: #0000ff;">for</span><span style="color: #000000;"> (</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> k</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;k</span><span style="color: #000000;"><</span><span style="color: #000000;">4</span><span style="color: #000000;">;k</span><span style="color: #000000;">++</span><span style="color: #000000;"> ){<br />              index</span><span style="color: #000000;">=</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">)(Math.random()</span><span style="color: #000000;">*</span><span style="color: #000000;">62</span><span style="color: #000000;">);<br />             fourResult[k]</span><span style="color: #000000;">=</span><span style="color: #000000;">characters[index];<br />         }<br />         </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;i</span><span style="color: #000000;"><</span><span style="color: #000000;">4</span><span style="color: #000000;">;i</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br />             code</span><span style="color: #000000;">+=</span><span style="color: #000000;">fourResult[i];           <br />         g.setColor(Color.RED);        <br />         g.drawString(code,</span><span style="color: #000000;">100</span><span style="color: #000000;">,</span><span style="color: #000000;">100</span><span style="color: #000000;">);<br />     }<br />     </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> </span><span style="color: #0000ff;">void</span><span style="color: #000000;"> main(String[] args){<br />         ValidationCode vc</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> ValidationCode();<br />         vc.setBounds(</span><span style="color: #000000;">300</span><span style="color: #000000;">,</span><span style="color: #000000;">300</span><span style="color: #000000;">,</span><span style="color: #000000;">200</span><span style="color: #000000;">,</span><span style="color: #000000;">200</span><span style="color: #000000;">);<br />         vc.setVisible(</span><span style="color: #0000ff;">true</span><span style="color: #000000;">);<br />         vc.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<br />     }<br /> }<br /> <br /> q行l果Q?br /> <br /> <img alt="" src="http://www.aygfsteel.com/images/blogjava_net/rorely/rs.jpg" height="200" width="198" /><br /> </span></div> <img src ="http://www.aygfsteel.com/rorely/aggbug/300773.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rorely/" target="_blank">期待明天</a> 2009-11-02 18:30 <a href="http://www.aygfsteel.com/rorely/archive/2009/11/02/300773.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>转蝲--使用EditPlus配置Java~译环境http://www.aygfsteel.com/rorely/archive/2009/11/02/300742.html期待明天期待明天Mon, 02 Nov 2009 08:07:00 GMThttp://www.aygfsteel.com/rorely/archive/2009/11/02/300742.htmlhttp://www.aygfsteel.com/rorely/comments/300742.htmlhttp://www.aygfsteel.com/rorely/archive/2009/11/02/300742.html#Feedback0http://www.aygfsteel.com/rorely/comments/commentRss/300742.htmlhttp://www.aygfsteel.com/rorely/services/trackbacks/300742.html
初学者更适合使用文本~辑软g来学习JavaQ对Java有一定认识后推荐使用EclipseQ对那些要求开发效率的E序员当焉选就是JBuilder?

         对于文本~辑软g我推荐EditPlusQEditPlus是很多程序员非常熟悉的编辑工P它以占用pȝ?/p>

源小、操作简便灵zR支持文件类型丰富(q能自定义文件类型){优点而被q泛使用。EditPlus?/p>

了具有编辑程序的功能Q还有灵zȝ~译功能Q下面就单介l一下EditPlus对Java~译讄?/p>

         在配|EditPlus之前是先Java的运行环境安装且调试好,然后q入EditPlusQ从菜单“工具

QToolsQ?#8221;;“配置用户工具...”q入用户工具讄Q选择“l和工具条目”中的“Group 1”Q点击面板右

边的“l名U?..”按钮Q将文本Group1”修改?#8220;Java~译E序”Q点?#8220;d工具”按钮Q选择应用E序Q?/p>

然后是修改属性:


1. d~译功能
“菜单文本”里的内容修改?#8220;Javac”Q?/p>

“命o”选择安装JDK后的Bin目录中的~译E序javac.exeQ我的JDK 安装路径?#8220;C:"Program

Files"JDK"j2sdk1.4.2_08”Q那么此路径?#8220;C:"Program Files"Java"jdk1.5.0"bin"javac.exe”Q?/p>

“参数”选择“文g?#8221;Q即昄?#8220;$(FileName)”Q?/p>

“初始目录”选择“文g目录”Q显CZؓ“$(FileDir)”Q选择“捕获输出”复选框

2. d执行功能
“菜单文本”里的内容修改?#8220;Java”Q?/p>

“命o”选择安装JDK后的BIN目录中的~译E序java.exeQ\径ؓ“C:"Program Files"Java"jdk1.5.0"bin"java.exe”Q?/p>

“参数”选择“不带扩展名的文g?#8221;Q即昄?#8220;$(FileNameNoExt)”Q?/p>

“初始目录”选择“文g目录”Q显CZؓ“$(FileDir)”Q千万不用选择“捕获输出”复选框Q?/p>

不然不会弹出命o控制収ͼ

         q样完成了EditPlus的基本设|,可以写一DJavaE序q行调试Q通过Ctrl+1q行~译Q?/p>

Ctrl+2q行E序Q错误提C都会显C在输出H口中,双击某一行错误信息,EditPlus会自动定位到?/p>

错行Q怎么P一个简单的Java IDE界面出C?/p>

ps: 要把你写?java代码保存C的java文g多w才行.



期待明天 2009-11-02 16:07 发表评论
]]>
随机C生,用于验证?/title><link>http://www.aygfsteel.com/rorely/archive/2009/11/02/300624.html</link><dc:creator>期待明天</dc:creator><author>期待明天</author><pubDate>Sun, 01 Nov 2009 16:16:00 GMT</pubDate><guid>http://www.aygfsteel.com/rorely/archive/2009/11/02/300624.html</guid><wfw:comment>http://www.aygfsteel.com/rorely/comments/300624.html</wfw:comment><comments>http://www.aygfsteel.com/rorely/archive/2009/11/02/300624.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rorely/comments/commentRss/300624.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rorely/services/trackbacks/300624.html</trackback:ping><description><![CDATA[<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000ff;">import</span><span style="color: #000000;"> java.io.</span><span style="color: #000000;">*</span><span style="color: #000000;">;<br /> </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">class</span><span style="color: #000000;"> AuthCode{<br />     </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> </span><span style="color: #0000ff;">static</span><span style="color: #000000;"> </span><span style="color: #0000ff;">void</span><span style="color: #000000;"> main(String[] args){<br />         </span><span style="color: #0000ff;">char</span><span style="color: #000000;">[] characters</span><span style="color: #000000;">=</span><span style="color: #000000;">{</span><span style="color: #000000;">'</span><span style="color: #000000;">A</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">B</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">C</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">D</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">E</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">F</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">G</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">H</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">I</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">J</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">K</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">L</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">M</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">N</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">O</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">P</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">Q</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">R</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">S</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">T</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">U</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">V</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">W</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">X</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">Y</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">Z</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">a</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">b</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">c</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">d</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">e</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">f</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">g</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">h</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">i</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">j</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">k</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">l</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">m</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">n</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">o</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">p</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">q</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">r</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">s</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">t</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">u</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">v</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">w</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">x</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">y</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">z</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">1</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">2</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">3</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">4</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">5</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">6</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">7</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">8</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">9</span><span style="color: #000000;">'</span><span style="color: #000000;">,</span><span style="color: #000000;">'</span><span style="color: #000000;">0</span><span style="color: #000000;">'</span><span style="color: #000000;">};<br />         </span><span style="color: #0000ff;">char</span><span style="color: #000000;">[] fourResult</span><span style="color: #000000;">=</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> </span><span style="color: #0000ff;">char</span><span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">];<br />         </span><span style="color: #0000ff;">int</span><span style="color: #000000;"> index;<br />         </span><span style="color: #0000ff;">for</span><span style="color: #000000;"> (</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> k</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;k</span><span style="color: #000000;"><</span><span style="color: #000000;">4</span><span style="color: #000000;">;k</span><span style="color: #000000;">++</span><span style="color: #000000;"> ){<br />              index</span><span style="color: #000000;">=</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">)(Math.random()</span><span style="color: #000000;">*</span><span style="color: #000000;">62</span><span style="color: #000000;">);<br />             fourResult[k]</span><span style="color: #000000;">=</span><span style="color: #000000;">characters[index];<br />         }<br />         </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">int</span><span style="color: #000000;"> i</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;i</span><span style="color: #000000;"><</span><span style="color: #000000;">4</span><span style="color: #000000;">;i</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br />             System.out.println(fourResult[i]);<br />     }<br /> }<br /> <br /> l果是随机的四个数字或字母组合:<br /> edio<br /> aB09<br /> </span></div> <img src ="http://www.aygfsteel.com/rorely/aggbug/300624.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rorely/" target="_blank">期待明天</a> 2009-11-02 00:16 <a href="http://www.aygfsteel.com/rorely/archive/2009/11/02/300624.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>java 环境变量讄http://www.aygfsteel.com/rorely/archive/2009/11/02/300623.html期待明天期待明天Sun, 01 Nov 2009 16:14:00 GMThttp://www.aygfsteel.com/rorely/archive/2009/11/02/300623.htmlhttp://www.aygfsteel.com/rorely/comments/300623.htmlhttp://www.aygfsteel.com/rorely/archive/2009/11/02/300623.html#Feedback0http://www.aygfsteel.com/rorely/comments/commentRss/300623.htmlhttp://www.aygfsteel.com/rorely/services/trackbacks/300623.html document.body.oncopy = function() { if (window.clipboardData) { setTimeout(function() { var text = clipboardData.getData("text"); if (text && text.length>300) { text = text + ""r"n"n本文来自CSDN博客Q{载请标明出处Q? + location.href; clipboardData.setData("text", text); } }, 100); } }

windows xp下配|JDK环境变量Q?br />       1.安装JDKQ安装过E中可以自定义安装目录等信息Q例如我们选择安装目录为D:"java"jdk1.5.0_08Q?/p>

  2.安装完成后,叛_“我的电脑”Q点?#8220;属?#8221;Q?

      3.选择“高”选项卡,点击“环境变量”Q?

      4.?#8220;pȝ变量”中,讄3属性,JAVA_HOME,PATH,CLASSPATH(大小写无所?,若已存在则点?#8220;~辑”Q不存在则点?#8220;新徏”Q?

      5.JAVA_HOME指明JDK安装路径Q就是刚才安装时所选择的\径D:"java"jdk1.5.0_08Q此路径下包括libQbinQjre{文件夹Q此变量最好设|,因ؓ以后q行tomcatQeclipse{都需要依*此变量)Q?br />      

       Path使得pȝ可以在Q何\径下识别java命oQ设为:

%JAVA_HOME%"bin;%JAVA_HOME%"jre"bin

    CLASSPATH为java加蝲c?class or lib)路径Q只有类在classpath中,java命o才能识别Q设为:

.;%JAVA_HOME%"lib"dt.jar;%JAVA_HOME%"lib"tools.jar (要加.表示当前路径)

  %JAVA_HOME%是引用前面指定的JAVA_HOMEQ?

       6.“开?#8221;Q?gt;;“q行”Q键?#8220;cmd”Q?

       7.键入命o“java -version”Q?#8220;java”Q?#8220;javac”几个命oQ出现画面,说明环境变量配置成功Q?

       8.好了Q打完收工。下面开始你的第一个javaE序吧?/p>

下面讲讲java几个环境变量的含义和linux下的配置ҎQ?/p>

通常Q我们需要设|三个环境变量:JAVA_HOME、PATH ?CLASSPATH?/p>

JAVA_HOMEQ该环境变量的值就?Java 所在的目录Q一?Java 版的软g和一?Java 的工具需要用到该变量Q设|?PATH ?CLASSPATH 的时候,也可以用该变量以方便设|?/p>

PATHQ指定一个\径列表,用于搜烦可执行文件的。执行一个可执行文gӞ如果该文件不能在当前路径下找刎ͼ则依ơ寻?PATH 中的每一个\径,直至扑ֈ。或者找?PATH 中的路径也不能找刎ͼ则报错。Java 的编译命?(javac)Q执行命?(java) 和一些工具命?(javadoc, jdb {? 都在其安装\径下?bin 目录中。因此我们应该将该\径添加到 PATH 变量中?/p>

CLASSPATHQ也指定一个\径列表,是用于搜?Java ~译或者运行时需要用到的cR在 CLASSPATH 列表中除了可以包含\径外Q还可以包含 .jar 文g。Java 查找cL会把q个 .jar 文g当作一个目录来q行查找。通常Q我们需要把 JDK 安装路径下的 jre"lib"rt.jar (Linux: jre/lib/rt.jar) 包含?CLASSPATH 中?/p>

PATH ?CLASSPATH 都指定\径列表,列表中的各项 (卛_个\? 之间使用分隔W分隔。在 Windows 下,分隔W是分号 (;)Q而在 Linux 下,分隔W是冒号 (:)?/p>

下面分别说明三个环境变量?Windows ?Linux 下如何设|,不过在此之前Q我们需要做个假设。假?JDK ?Windows 下的安装路径?C:"jdk"Q在 Linux 下的安装路径?/usr/local/jdk/。那么,安装后的 JDK 臛_会包括如下内容:

C:"jdk (/usr/local/jdk)
|-- bin
|-- demo
|-- include
|-- jre
| |-- bin
| `-- lib
`-- lib

***** ?Windows 下设|?/p>

Windows 下?set 命o讄环境变量Qؓ了每一ơ启动计机都设|这些环境变量,应该在系l盘根目录下?autoexec.bat 文g中进行设|,如:

set JAVA_HOME=C:"jdk
set PATH=%JAVA_HOME%"bin;C:"Windows;C:"Windows"Command
set CLASSPATH=%JAVA_HOME%"jre"lib"rt.jar;.

有些版本?Windows 不能?%变量? 来替换环境变量的内容Q那么就只好直接?C:"jdk 而不?%JAVA_HOME% 了。另外,C:"Windows ?C:"Windows"Command ?Windows 会自动加入\径的Q所以可以从讄中去掉。如果在 autoexec.bat 中已l设|了 PATHQ那只需要将 %JAVA_HOME%"bin 加到原来讄 PATH 的那条语句中p了?/p>

CLASSPATH 也可以根据需要设|或者加入其它的路径Q比如你x自己写的一些类攑֜ C:"java 中,可以把 C:"java 也添加到 CLASSPATH 中去Qset CLASSPATH=%JAVA_HOME%"jre"lib"rt.jar;C:"java;.?/p>

注意Q在 CLASSPATH 中包含了一?#8220;当前目录 (.)”。包含了该目录后Q就可以CQ意目录下L行需要用到该目录下某个类? Java E序Q即使该路径q未包含?CLASSPATH 中也可以。原因很单:虽然没有明确的把该\径包含在 CLASSPATH 中,? CLASSPATH 中的 “.” 在此时就代表了该路径Q如Q?/p>

假设?C:"java 目录下有可运行的c?HelloJava.classQ那?/p>

C:"> set CLASSPATH=C:"jdk"jre"lib"rt.jar;. // 讄 CLASSPATH 环境变量Q注意最后有一?“.”
C:"> cd java // 转到 C:"java 目录
C:"java> java HelloJava // q行 HelloJava
Hello, Java. // q行l果
C:"java> _

**** ?Linux 下设|?/p>

Linux 下?#8220;变量?变量?#8221;讄变量Qƈ使用 export 命o其导出为环境变量。ؓ了每一ơ登录都自动讄好这些变量,你需要在 ~/.bash_profile 里或?~./bashrc 里进行设|,?/p>

export JAVA_HOME=/usr/local/jdk
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=$JAVA_HOME/jre/lib/rt.jar:.

讄 PATH 时用?$JAVA_HOME 是指替换变量 JAVA_HOME 的值到 $JAVA_HOME 所在位|。如上句实际是 export PATH=/usr/local/jdk/bin:$PATH。这句中 $PATH 也是同样的作用,不过q里?PATH 是指以前讄?PATH 变量的|而非本次讄 PATH 变量的倹{?/p>

注意Q在 CLASSPATH 中包含了一?#8220;当前目录 (.)”。包含了该目录后Q就可以CQ意目录下L行需要用到该目录下某个类? Java E序Q即使该路径q未包含?CLASSPATH 中也可以。原因很单:虽然没有明确的把该\径包含在 CLASSPATH 中,? CLASSPATH 中的 “.” 在此时就代表了该路径Q例?/p>

假设?/home/fancy/java 目录下有可运行的c?HelloJava.classQ那?/p>

[fancy@matrix fancy]$ export CLASSPATH=/usr/local/jdk/jre/lib/rt.jar:. // 讄 CLASSPATHQ注意最后的“.”
[fancy@matrix fancy]$ cd ~/java // 转到 /home/fancy/java
[fancy@matrix java]$ pwd // 昄当前目录
/home/fancy/java // 当前目录?/home/fancy/java
[fancy@matrix java]$ java HelloJava // q行 HelloJava
Hello, Java // q行l果
[fancy@matrix java]$ _

?/p>

***** 实例分析

只是操作pȝ不同Q略有差别?/p>

两个例子都提C?#8220;可运行的c?#8221;Q它是指包含?public static void main(String[] args) Ҏ的类Q这在下一?HelloJava 一节中详述。例中的 CLASSPATH 均未包含 HelloJava.class 所在的目录(C:"java, /home/fancy/java)Q但是均包含了当前目?(.)。因此{到包?HelloJava.class 的目录下L?java HelloJavaQ在 Java L?CLASSPATH 中的“. (当前目录QC:"java, /home/fancy/java)”Ӟ扑ֈ?HelloJava.classQ运行成功?/p>

期待明天 2009-11-02 00:14 发表评论
]]>
Java开发者必ȝ技术网?/title><link>http://www.aygfsteel.com/rorely/archive/2009/08/03/289612.html</link><dc:creator>期待明天</dc:creator><author>期待明天</author><pubDate>Mon, 03 Aug 2009 08:26:00 GMT</pubDate><guid>http://www.aygfsteel.com/rorely/archive/2009/08/03/289612.html</guid><wfw:comment>http://www.aygfsteel.com/rorely/comments/289612.html</wfw:comment><comments>http://www.aygfsteel.com/rorely/archive/2009/08/03/289612.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rorely/comments/commentRss/289612.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rorely/services/trackbacks/289612.html</trackback:ping><description><![CDATA[<table style="width: 100%;" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="padding: 15px 0pt 5px; font-size: 16pt; font-family: 宋体; font-weight: bold;"><span id="lbl_title_l">Java开发者必ȝ技术网?/span></td> </tr> <tr> <td style="padding: 0pt 0pt 5px; font-size: 11pt; font-family: 宋体;"> <br /> </td> </tr> <tr> <td style="padding: 5px 0pt 0pt;"> <span id="lbl_author">作者:      旉Q?008-8-5 0:00:00</span></td> </tr> <tr> <td style="padding: 20px 10px 0pt;"> <span id="lbl_content"> <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td> <p><font face="Verdana"><strong>英文|站 <br /> </strong>http://www.javaalmanac.com - Java开发者年鉴一书的在线版本. 要想快速查到某UJava技巧的用法及示例代? q是一个不错的d. <br /> http://www.onjava.com - O'Reilly的Java|站. 每周都有新文? <br /> http://java.sun.com - 官方的Java开发者网?- 每周都有新文章发? <br /> http://www.developer.com/java - 由Gamelan.com l护的Java技术文章网? <br /> http://www.java.net - Sun公司l护的一个JavaC֌|站. <br /> http://www.builder.com - Cnet的Builder.com|站 - 所有的技术文? 以JavaZ. <br /> http://www.ibm.com/developerworks/java - IBM的Developerworks技术网? q是其中的Java技术主? <br /> http://www.javaworld.com - 最早的一个Java站点. 每周更新Java技术文? <br /> http://www.devx.com/java - DevXl护的一个Java技术文章网? <br /> http://www.fawcette.com/javapro - JavaPro在线杂志|站. <br /> http://www.sys-con.com/java - Java Developers Journal的在U杂志网? <br /> http://www.javadesktop.org - 位于Java.net的一个Java桌面技术社区网? <br /> http://www.theserverside.com - q是一个讨论所有Java服务器端技术的|站. <br /> http://www.jars.com - 提供Java评论服务. 包括各种framework和应用程? <br /> http://www.jguru.com - 一个非常棒的采用Q&A形式的Java技术资源社? <br /> http://www.javaranch.com - 一个论坛,得到Java问题{案的地方,初学者的好去处?<br /> http://www.ibiblio.org/javafaq/javafaq.html - comp.lang.java的FAQ站点 - 攉了来自comp.lang.java新闻l的问题和答案的分类目录. <br /> http://java.sun.com/docs/books/tutorial/ - 来自SUN公司的官方Java指南 - 对于了解几乎所有的java技术特性非常有帮助. <br /> http://www.javablogs.com - 互联|上最z跃的一个Java Blog|站. <br /> http://java.about.com/ - 来自About.com的Java新闻和技术文章网? <br /> <a >http://www.objectlearn.com/index.jsp</a><br /> </font></p> <p><font face="Verdana"><strong>中文|站</strong><br /> http://community.csdn.net/expert/forum.asp   CSDN技术社?br /> http://www.java360.cn/ Java开源世?了解Java开源不得不ȝ地方<br /> http://www-900.ibm.com/developerWorks/cn/java/index.shtml<br /> http://diy.ccidnet.com/pub/article/c317_a71330_p1.html  赛_|J2EE专题<br /> http://www.javaresearch.org/    Java研究l织<br /> http://www.jdon.com/   J道-Java和J2EE解决之道</font></p> </td> </tr> </tbody> </table> </span></td> </tr> </tbody> </table> <img src ="http://www.aygfsteel.com/rorely/aggbug/289612.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rorely/" target="_blank">期待明天</a> 2009-08-03 16:26 <a href="http://www.aygfsteel.com/rorely/archive/2009/08/03/289612.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>【{】Vista下Java环境变量配置http://www.aygfsteel.com/rorely/archive/2009/08/01/289380.html期待明天期待明天Sat, 01 Aug 2009 04:41:00 GMThttp://www.aygfsteel.com/rorely/archive/2009/08/01/289380.htmlhttp://www.aygfsteel.com/rorely/comments/289380.htmlhttp://www.aygfsteel.com/rorely/archive/2009/08/01/289380.html#Feedback0http://www.aygfsteel.com/rorely/comments/commentRss/289380.htmlhttp://www.aygfsteel.com/rorely/services/trackbacks/289380.html转自Qhttp://hi.baidu.com/wakin175/blog/item/9c675faf4fe8a6fefaed5036.html

Vista下Java环境变量配置?br /> 假设JDK安装路径Q?br /> E:"Program Files"Java"jdk1.6.0_05

以下的变量可以设|成用户变量Q业可以讄成系l变量。他们的区别只是使用权限的问题而已?/p>

W一U方法:
建立两个变量Q?br /> 变量名:PATH
变量|E:"Program Files"Java"jdk1.6.0_05"bin

变量名:CLASSPATH
变量|.;E:"Program Files"Java"jdk1.6.0_05"lib"tools.jar;E:"Program Files"Java"jdk1.6.0_05"jre"lib"dt.jar
【注意开头是句号加分好?/p>


W二U方法:
建立三个环境变量
变量名:JAVA_HOME
变量|E:"Program Files"Java"jdk1.6.0_05   注:JDK安装路径

变量名:PATH
变量|%JAVA_HOME%"bin

变量名:CLASSPATH
变量|.;%JAVA_HOME%"lib"tools.jar;%JAVA_HOME%"jre"lib"dt.jar
【注意开头是句号加分好?/p>

【以下错误是|上摘录的?br /> 错误的原?其实在整个设|过E知道以下几点就可以?/p>

1,PATH,CLASSPATH{?大小写都无所?(有些人可能会在这个上面纠~很?

2,只需要设|着3个变?别听别h说还有其他变?/p>

3,环境变量有系l变量和用户变量,讄成哪个都?如果是系l变量的话对于所有登陆用此电脑?/p>

用户都有?用户变量只对相应用户起作?/p>

4,变量值最后的;(分号)可带可不?我这里说的最后一个分?处于中间位置的不可省?

5,注意区别/,"在WINDOWS里的路径名一般用"(反斜?,但有时我们发现其?也可?最好?,

"在C/C++里是转义字符的意??是HTTTP,FTP协议的\径符?/p>

6,我的例子之所以把JAVA_HOME讄为C:"Java"jdk1.6.0_01,是因为我的JDK安装路径军_?大家

可以Ҏ自己的安装\径调整此变量.

好了,在细心留意了着6点后,我们的JDK讄没有问?但是光说q不行还得实际测试一?q里我想?/p>

一下几中有在DOS下输入JAVA -VERSION(JAVA后有I格)后出现版本信息就说明讄成功?着

实际上是不能说明M问题,正确的应该是我们~写了一个JAVA程序后,通过JAVAC~译成功生成

CLASS文g才表C我们的讄是正的.

我们在初ơ编写JAVAE序的时候是用记事本写的,因ؓ它无?DEBUG现在已经很少有h用了,推荐

使用JBUILDER,ECLIPSE,JCREATOR~辑工具!

期待明天 2009-08-01 12:41 发表评论
]]>
վ֩ģ壺 | | ξ| ˮ| | Ĭ| ʮ| ֣| | | | ʯ| | Դ| Ϻ| | | ̩| | ƾ| ̶| | ɽ| Ϫ| | | | Ȫ| | ں| | ָ| ʦ| ƺ| | ͬ| ɽ| | | ǰ| |