³õѧJAVAÖ®Ò»
1¡¢ Ò»¸öÊýÈç¹ûÇ¡ºÃµÈÓÚÆäÒò×Ó£¨³ýÁ˱¾ÉíÒÔÍâµÄÔ¼ÊýÖ®ºÍ£©£¬¸ÃÊý¾Í³ÆΪ“ÍêÊý”¡£±àдһ¸ö Java Application ³ÌÐò£¬Çó³ö 1000 ÒÔÄÚµÄËùÓÐÍêÊý¡£
public class homework11
{
public static void main(String[] args)
//Êä³ö1000ÒÔÄÚµÄËùÓÐÍêÊý
{
int sum;
System.out.print( "**********1000ÒÔÄÚµÄËùÓÐÍêÊýÈçÏÂ:");
System.out.println(); //»»ÐÐ
for(int i = 1; i <= 1000; i++)
{
sum=0;//³õʼ»¯sum±äÁ¿£¬²¢ÔÚÿ¸öiµÄforµÄÑ»·ºóʹsumÖµ¹éÁã
for(int j = 1; j < i; j++){
if(i % j == 0) //È¡ÓàÊý
sum = sum + j;//Çói³ýÁ˱¾ÉíÒÔÍâµÄËùÓÐÔ¼ÊýÖ®ºÍ
}
if(sum == i) //ÅжÏiÊÇ·ñΪÍêÊý£¬¼´ÅжÏiÊÇ·ñµÈÓÚ³ýÁ˱¾ÉíÒÔÍâµÄÔ¼ÊýÖ®ºÍ
System.out.println( "-~-~-~-~-~-~-~-~-~-~-~-~-~-~~~~~"+i + "ÊÇÍêÊý");
//Êä³öÍêÊý
} //½áÊøforÑ»·
System.out.println(); //»»ÐÐ
} //½áÊømainº¯Êý
}//½áÊøclass
ÔËÐнá¹û£º
D:\jdk\xi>javac homework11.java
D:\jdk\xi>java homework11
**********1000ÒÔÄÚµÄËùÓÐÍêÊýÈçÏÂ:
-~-~-~-~-~-~-~-~-~-~-~-~-~-~~~~~6ÊÇÍêÊý
-~-~-~-~-~-~-~-~-~-~-~-~-~-~~~~~28ÊÇÍêÊý
-~-~-~-~-~-~-~-~-~-~-~-~-~-~~~~~496ÊÇÍêÊý
2¡¢±àдһ¸ö³ÌÐò£¬°Ñ±äÁ¿ n µÄ³õʼֵÉèÖÃΪ 1678£¬È»ºóÀûÓóý·¨ÔËËãºÍÈ¡ÓàÔËËã°Ñ±äÁ¿µÄÿλÊý×Ö¶¼Ìá³öÀ´²¢´òÓ¡£¬Êä³ö½á¹ûΪ£º n £½ 1678
public class homework12 {
// ÏÔʾָ¶¨ÊýµÄÿһλÊý×Ö
private void show() {
int n = 1678; //±äÁ¿ n µÄ³õʼֵÉèÖÃΪ 1678
int a,b,c,d; &nbs
Ïà¹ØÎĵµ£º
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......
ÔÚ¿´µ½Thinking in java µÚËÄÕÂʱ³õʼ»¯Ïà¹ØÎÊÌâµÄʱºò£¬ÎÒÃDz»ÓɵذÑ×¢ÒâÁ¦ÒƵ½¹¹ÔìÆ÷ÉÏ¡£ÕâÀï×ö¸ö¼òµ¥µÄ×ܽᣬ±ãÓÚ¸ßÊÖÖ¸ÕýÒÔ¼°×Ô¼ºÎ¹ʡ£
Ê×Ïȹ¹ÔìÆ÷ÊÇÒª¹¹ÔìÒ»¸ö¶«Î÷{¹¹Ôì¶ÔÏó£¨ÊµÀý£©}²¢¶ÔÆä³õʼ»¯¡£Ö®ËùÒÔ ......
JavaÈÝÆ÷ÀàѧϰÐĵÃ
ÓÉÓÚÎÒ¶ÔC++±È½ÏÊìϤ£¬ËùÒÔѧϰJavaÓ¦¸ÃÖصãÌå»áJava´øÀ´µÄиÅÄî¡£±¾ÎÄ»ù±¾ÉÏÊÇJava±ê×¼¿âÖм¯ºÏ¿ò¼ÜµÄ»ù±¾¸ÅÄûÓÐÀý×Ó¡£Ð´±¾ÎĵÄÄ¿µÄÔÚÓÚ·½±ãÎҺܳ¤Ê±¼äºóÈôÊÇÍüÁËÕâЩ¶«Î÷¿ÉÒÔͨ¹ýÕâƬÎÄÕÂѸËÙ»ØÒäÆðÀ´¡£
1. ½Ó¿Ú
Õû¸öJavaÈÝÆ÷ÀàµÄ»ù´¡ÊÇÈÝÆ÷½Ó¿Ú£¨ÀýÈçCollection£¬MapµÈ½Ó¿Ú£©£¬¶ø²»ÊÇÀà ......
JSPµÄ9¸öÄÚÖöÔÏóÊÇ£ºout¡¢request¡¢response¡¢page¡¢pageContext¡¢session¡¢application¡¢exception¡¢config¡£Òª×¢Òâ¶ÔÏóÃûµÄ´óСд
What results from attempting to compile and run the following code? public class Ternary{ public static void main(String args[]){ int a = 5; System.out.printl ......
JavaÊý¾Ý¿âÁ¬½Ó£¨JDBC£©ÓÉÒ»×éÓà Java ±à³ÌÓïÑÔ±àдµÄÀàºÍ½Ó¿Ú×é³É¡£JDBC Ϊ¹¤¾ß/Êý¾Ý¿â¿ª·¢ÈËÔ±ÌṩÁËÒ»¸ö±ê×¼µÄ API£¬Ê¹ËûÃÇÄܹ»Óô¿Java API À´±àдÊý¾Ý¿âÓ¦ÓóÌÐò¡£È»¶ø¸÷¸ö¿ª·¢É̵Ľӿڲ¢²»ÍêÈ«Ïàͬ£¬ËùÒÔ¿ª·¢»·¾³µÄ±ä»¯»á´øÀ´Ò»¶¨µÄÅäÖñ仯¡£±¾ÎÄÖ÷Òª¼¯ºÏÁ˲»Í¬Êý¾Ý¿âµÄÁ¬½Ó·½Ê½¡£
¡¡¡¡Ò»¡¢Á¬½Ó¸÷ÖÖÊý¾Ý¿ ......