¡¾JAVAѧϰ±Ê¼Ç¡¿02 ÔËËã·û¡¢±í´ïʽ
Ò»¡¢ÔËËã·û
ËãÊõÔËËã·û£º+£¬-£¬*£¬/£¬%£¬++£¬--
¹ØϵÔËËã·û£º>£¬<£¬>=£¬<=£¬==£¬!=
²¼¶ûÂß¼ÔËËã·û£º!£¬&£¬^£¬|£¬&&£¬||
λÔËËã·û£º&£¬|£¬^£¬>>£¬<<£¬>>>
¸³ÖµÔËËã·û£º=
À©Õ¹¸³ÖµÔËËã·û£º+=£¬-=£¬*=£¬/=
×Ö·û´®Á´½ÓÔËËã·û£º+
Á½ÊýÏà³ý£¬ÄÇôÈç¹û½ÓÊÕµÄÖµÊÇÕûÐÍ£¬Ôò×Ô¶¯½«Ð¡ÊýµãÈ¥µô£¬0.5→0
%£ºÈ¡Ä££¬¼´ÓàÊý
++£º×ÔÔö
--£º×Ô¼õ
public class JavaDemo01
{
public static void main(String args[])
{
int i = 10 ;
int j = 20 ;
int k = i % j ;
System.out.println(k) ;
}
};
i++Óë++iµÄÇø±ð£º
public class JavaDemo03
{
public static void main(String args[])
{
int i = 10 ;
// i++ ;
// ÒÔÉÏ´úÂëÏ൱ÓÚÒÔϵijÌÐò¶Î£º
// i = i + 1 ;
// ++i£º±íʾÏÈÈÃÊý¾Ý×ÔÔö£¬Ö®ºóÔÙ½øÐвÙ×÷
// i++£º±íʾÏÈÈÃÊý¾Ý½øÐвÙ×÷£¬²Ù×÷Íê³ÉÖ®ºó½øÐÐ×ÔÔö
int k = 10+(++i) ;
System.out.println(k) ;
System.out.println(i) ;
}
};
Âß¼ÔËËã·û·µ»ØµÄ¶¼ÊDz¼¶ûÖµ
public class JavaDemo04
{
public static void main(String args[])
{
int i = 10 ;
int j = 11 ;
System.out.println(i!=j) ;
}
};
ÔÚ³ÌÐòÖГ=”ÊDZíʾ¸³Öµ£¬¶ø“==”Ôò±íʾÂß¼ÔËË㣬ÅжÏÁ½ÕßÊÇ·ñÏàµÈ¡£
¶þ¡¢²¼¶ûÂß¼ÔËËã·û
&&£ºµÚÒ»¸ö²Ù×÷ÊýΪ¼Ù£¬Ôò²»Åжϵڶþ¸ö²Ù×÷Êý
||£ºµÚÒ»¸ö²Ù×÷ÊýΪÕ棬Ôò²»Åжϵڶþ¸ö²Ù×÷Êý
public class JavaDemo02
{
public static void main(String args[])
{
// ÅжÏÒ»¸öÊý×ÖÊÇ·ñÊÇżÊý
// żÊýµÄ×î´óÌص㣺³ýÒÔ2ÓàÊýΪ0
int i = 21 ;
if(i%2==0)
{
System.out.println("ÊÇÒ»¸öżÊý¡£") ;
}
}
};
public class JavaDemo06
{
public static void main(String args[])
{
// ѧÉúÉÏѧµÄÄêÁäÔÚ5~7ËêÖ®¼ä
// Èç¹û³É¼¨ÔÚ90·Ö£¬»òÕßÄêÁäÔÚ7Ë꣬Ôò±íʾÊÇÒ»¸öѧÉú
int age = 6 ;
int score = 90 ;
// 5<=age>=7 : age>=5 age<=7
// boolean flag = age>=5&&age<=7 ;
boolean flag = age==7 | score==90 ;
System.out.println(flag) ;
}
};
Èý¡¢¸³ÖµÔËËã·û
µ±&ldqu
Ïà¹ØÎĵµ£º
Ôڳɹ¦ÊµÏÖJavaµ÷ÓÃC++Ö®ºó£¬½ÓÏÂÀ´Ïëµ½ÄÜ·ñͨ¹ýJNAʵÏÖJavaµ÷ÓÃFortran£¬½ñÌìÊÔÑéÁËһϣ¬»¹ÊDZȽÏÈÝÒ׵ġ£
ÍøÉÏÓÐÒ»¸öJavaµ÷ÓÃF95µÄÀý×Ó£¬µ«ÊÇÎÒ¿¼ÂDz»½öҪʵÏÖF95µÄµ÷Ó㬻¹ÒªÊµÏÖF77µÄµ÷Óã¬ËùÒÔ·ÑÁËһЩÖÜÕÛ¡£
ÎÊÌâµÄ¹Ø¼üÔÚÓÚF77Ϊ¹ý³ÌÃû×Ô¶¯Ìí¼ÓÁËÒ»¸öβ²¿µÄÏ»®Ïߣ¬ËùÒÔsub1Õâ¸ö¹ý³Ì£¬µ½JavaÒ»¶Ë£¬¾Í±ä³ÉÁËsub1_£¬ ......
ÐÞ¸ÄJavaÎļþ²»ÓÃÖØÆôTomcat·þÎñµÄ·½·¨
ÔÚʹÓÃEclipse+Tomcat¿ª·¢JavaÏîÄ¿µÄʱºò³£³£»áÅöµ½ÕâÑùµÄÇé¿ö£¬ÒÑÐÞ¸ÄJavaÎļþTomcat¾Í»á×Ô¶¯ÖØÆô£¬½ÓÏÂÀ´¾ÍÊÇÂþ³¤µÄµÈ´ý·þÎñÖØÆôÍê±Ï¡£ÄÇÆäʵ´ó¶àÊýµÄJavaÎļþÐÞ¸ÄÊÇûÓбØÒªÖØÆô·þÎñµÄ£¬Ö»ÓÐһЩÌض¨µÄJavaÎļþ£¬±ÈÈç˵ֻÓÐÖØÆô·þÎñµÄʱºò²Å»áµ÷Ó ......
Íøַץȡ Java API ¸ÅÊö
http://code.google.com/intl/zh-CN/appengine/docs/java/urlfetch/usingjavanet.html
App Engine Ó¦ÓóÌÐò¿ÉÒÔÓëÆäËûÓ¦ÓóÌÐò½øÐÐͨÐÅ»òͨ¹ýץȡÍøÖ··ÃÎÊÍøÂçÉϵÄÆäËû×ÊÔ´¡£Ó¦ÓóÌÐò¿ÉÒÔʹÓÃÍøַץȡ·þÎñÀ´·¢³ö HTTP ºÍ HTTPS ÇëÇó²¢½ÓÊÕÏìÓ¦¡£³öÓÚЧÂʺÍÀ©Õ¹ÐÔ¿¼ÂÇ£¬Íøַץȡ·þÎñʹÓà G ......
×ֺţº´ó ÖРС
import java.awt.Graphics;
import java.io.File;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.SourceDataLine;
public class M ......
1.¼ÆËãijһÔ·ݵÄ×î´óÌìÊý
Calendar time=Calendar.getInstance();
time.clear();
time.set(Calendar.YEAR,year); //year Ϊ int
time.set(Calendar.MONTH,i-1);//×¢Òâ,Calendar¶ÔÏóĬÈÏÒ»ÔÂΪ0
int day=time.getActualMaximum(Calendar.DAY_OF_MON ......