Java°üµÄ´´½¨ºÍʹÓÃ
°üÊÇJavaÓïÑÔÌṩµÄÒ»ÖÖÇø±ðÀàÃû×ÖÃüÃû¿Õ¼äµÄ»úÖÆ£¬ËüÊÇÀàµÄÒ»ÖÖÎļþ×éÖ¯ºÍ¹ÜÀí·½Ê½¡¢ÊÇÒ»×鹦ÄÜÏàËÆ»òÏà¹ØµÄÀà»ò½Ó¿ÚµÄ¼¯ºÏ¡£Java packageÌṩÁË·ÃÎÊȨÏÞºÍÃüÃûµÄ¹ÜÀí»úÖÆ£¬ËüÊÇJavaÖкܻù´¡È´Óַdz£ÖØÒªµÄÒ»¸ö¸ÅÄî¡£
Ò»¡¢°üµÄ×÷ÓÃ
1 °Ñ¹¦ÄÜÏàËÆ»òÏà¹ØµÄÀà»ò½Ó¿Ú×éÖ¯ÔÚͬһ¸ö°üÖУ¬·½±ãÀàµÄ²éÕÒºÍʹÓá£
2 ÈçͬÎļþ¼ÐÒ»Ñù£¬°üÒ²²ÉÓÃÁËÊ÷ÐÎĿ¼µÄ´æ´¢·½Ê½¡£Í¬Ò»¸ö°üÖеÄÀàÃû×ÖÊDz»Í¬µÄ£¬²»Í¬µÄ°üÖеÄÀàµÄÃû×ÖÊÇ¿ÉÒÔÏàͬµÄ£¬µ±Í¬Ê±µ÷ÓÃÁ½¸ö²»Í¬°üÖÐÏàͬÀàÃûµÄÀàʱ£¬Ó¦¸Ã¼ÓÉÏ°üÃû¼ÓÒÔÇø±ð¡£Òò´Ë£¬°ü¿ÉÒÔ±ÜÃâÃû×Ö³åÍ»¡£
3 °üÒ²ÏÞ¶¨ÁË·ÃÎÊȨÏÞ£¬ÓµÓаü·ÃÎÊȨÏÞµÄÀà²ÅÄÜ·ÃÎÊij¸ö°üÖеÄÀà¡£
¶þ¡¢°üµÄ¶¨Òå
ÔÚÒ»¸ö.javaÎļþÖпÉÒÔÒ»¸öpublicÀàºÍ¶à¸ö·ÇpublicÀ࣬Èç¹ûÒª½«ÕâЩÀà×éÖ¯ÔÚÒ»¸ö°üµ±ÖУ¬ÔòÔÚ.javaÎļþÖгý×¢ÊÍÒÔÍâµÄµÚÒ»ÐÐʹÓùؼü×Öpackage¼´¿ÉʵÏÖ¡£µ±ÐèÒªµ÷Óô˰üÖеÄÀàʱ£¬¾Í¿ÉÒÔʹÓùؼü×Öimport½øÐе¼Èë¡£ÔÚ¶¨Òå°üµÄʱºò£¬Ó¦¸Ã×¢Ò⼸µã:
1 ΪÁ˾¡Á¿Ê¹°üÃû±£³ÖΨһÐÔ£¬°üÃûͨ³£²ÉÓÃСд¡¢°´µ¹Ð´»¥ÁªÍøÖ·µÄÐÎʽ½øÐж¨Òå¡£Èç:com.hank.www±íʾ°üÎļþ·ÅÖõÄÎļþ·¾¶Îªcom\hank\www¡£
2 ÔÚ½øÐÐÃüÃû°üʱ£¬Ó¦¸Ã±ÜÃâʹÓÃÓëϵͳ·¢Éú³åÍ»µÄÃû×Ö£¬Èçjava.lang¡¢java.swingµÈ¡£
Èý¡¢java°ü´´½¨ºÍʹÓò½Öè
²½Öè1ÔÚCÅ̸ùĿ¼Ï´´½¨javaÎļþ¼Ð£¬ÆäÏ·ÅÖÃÓÐÔ´ÎļþHelloWorld.javaºÍMyTest.java¡£±àд°üÔ´Îļþ´úÂëHelloWorld.javaºÍ²âÊÔÔ´Îļþ´úÂëMyTest.java¡£ÈçÏ£º
//HelloWorld.java
package com.hank.www;
public class HelloWorld
{
public HelloWorld(){System.out.println("Hello,World !");}
public void display(){System.out.println("Welcome to the java programming world !");}
}
//MyTest.java
import com.hank.www.HelloWorld;
public class MyTest
{
public static void main(String[] args)
{
HelloWorld hw=new HelloWorld();
Ïà¹ØÎĵµ£º
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_MONTH);//±¾Ô·ݵÄÌìÊý
×¢£ºÔÚʹÓÃset·½·¨Ö®Ç°£¬±ØÐëÏÈ ......
JavaÖÐÌṩÁ˷ḻµÄÈÕÆÚ±íʾ·½Ê½¡£ÆäÖаüÀ¨Date¡¢Timestamp¡¢Calendar¡¢GregorianCalendarÀà¡£GregorianCalendarÀàÖÐÌṩÁËÓÃÓÚ¼ÆËãÈÕÆÚµÄadd()·½·¨£¬¿ÉÒԺܷ½±ãµØ¼ÆËãÈô¸ÉÄê¡¢Ô¡¢ÈÕºóµÄÈÕÆÚ¡£
¸ø¸öÀý×Ó¿´¿´£º
package testjava;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import ......
×î½üÑо¿ÏÂsocket,ctrl+vÁËÏÂÍøÉϵĶ«Î÷:
ÊÂʵÉÏÍøÂç±à³Ì¼òµ¥µÄÀí½â¾ÍÊÇÁ½Ì¨¼ÆËã»úÏ໥ͨѶÊý¾Ý¶øÒÑ¡£¶ÔÓÚ³ÌÐòÔ±¶øÑÔ£¬È¥ÕÆÎÕÒ»ÖÖ±à³Ì½Ó¿Ú²¢Ê¹ÓÃÒ»ÖÖ±à³ÌÄ£ÐÍÏà¶Ô¾Í»áÏԵüòµ¥µÄ¶àÁË¡£Java SDKÌṩһЩÏà¶Ô¼òµ¥µÄApiÀ´Íê³ÉÕâЩ¹¤×÷£¬Socket¾ÍÊÇÆäÖÐÖ®Ò»¡£
¡¡¡¡¶ÔÓÚJava¶øÑÔ¡£ÕâЩApi´æÔÚÓëJava.netÕâ¸ö ......
Õâ¶Ìʱ¼ä£¬Íê³ÉÁËÒ»¸ö½ÏΪ¼òµ¥µÄϵͳ Ò»¸ö½ÌÓýÅàѵ»ú¹¹µÄÐÅÏ¢¹ÜÀíϵͳ£¬Ö÷ÒªÊÇͨ¹ý²»Í¬µÄ½ÇÉ«·ÖÅä½øÈ벻ͬµÄ½çÃ棬×öÏàÓ¦µÄ¹¤×÷£¬ÒòΪÔÚȨÏÞ·½Ã滹ûŪºÃ£¬Ã»ÓÐÓõ½Ajax¡£½ÇÉ«ÓÐϵͳ¹ÜÀíÔ±£¬×ÉѯÖ÷¹Ü£¬×Éѯʦ£¬Êг¡×¨Ô±£¬Êг¡²¿Ö÷¹Ü£¬ÁªÏµÈË£¬µÈµÈ¡£ÒòΪµ±³õдµÄʱºò£¬ÏµÍ³µÄÀ©Õ¹ÐÔ»¹¿ÉÒÔ£¬ËùÒÔÄã¿ÉÒÔÔö¼ÓÒ»¸ö½ÇÉ«£¬ ......
Ò»¡¢windowsÏ¿ª·¢»·¾³µÄ´î½¨
1¡¢´Óhttp://java.sun.com/ÉÏÏÂÔØwindowsƽ̨µÄJDK,²¢°²×°¡£¼ÙÉ谲װĿ¼Ϊ£ºC:\jdk6.0
2¡¢É趨Ïà¹Ø»·¾³Á¿£¨ÒÔwindowsXP)Àý£º
1¡¢ÓÒ»÷×ÀÃæÉÏ“ÎҵĵçÄÔ”£¬Ñ¡ÔñÊôÐÔ
2¡¢ÔÙÑ¡Ôñ“¸ß¼¶”»îÒ ......