Java ±à³ÌµÄ¶¯Ì¬ÐÔ£¬µÚ 1 ²¿·Ö: ÀàºÍÀà×°Èë
ÕâÒ»ÓÐ¹Ø Java ±à³Ì¶¯Ì¬·½ÃæµÄеÄϵÁÐÎÄÕÂÑо¿ÁËÖ´ÐÐ Java Ó¦ÓóÌÐòʱĻºóËù·¢ÉúµÄÊÂÇé¡£ÆóÒµ Javaר¼Ò
Dennis Sosnoski ÌṩÁË Java ¶þ½øÖÆÀà¸ñʽÒÔ¼°ÔÚ JVM
ÄÚ²¿ÀàËù·¢ÉúµÄÇé¿öµÄÄÚÄ»¡£½Ó×Å£¬Ëû½«ÌÖÂÛÀà×°ÈëÎÊÌ⣬Æ䷶ΧÉæ¼°´ÓÔËÐмòµ¥µÄ Java Ó¦ÓóÌÐòËùÐèµÄÀàµÄÊýÁ¿µ½¿ÉÄÜÔì³É J2EE
¼°ÀàËƵĸ´ÔÓÌåϵ½á¹¹³öÏÖÎÊÌâµÄÀà×°ÈëÆ÷³åÍ»¡£
±¾ÎÄÊÇÕâ¸öÐÂϵÁÐÎÄÕµĵÚһƪ£¬¸ÃϵÁÐÎÄÕ½«ÌÖÂÛÎÒ³Æ֮Ϊ
Java ±à³ÌµÄ¶¯Ì¬ÐÔ
µÄ
һϵÁÐÖ÷Ìâ¡£ÕâЩÖ÷ÌâµÄ·¶Î§´Ó Java
¶þ½øÖÆÀàÎļþ¸ñʽµÄ»ù±¾½á¹¹£¬ÒÔ¼°Ê¹Ó÷´Éä½øÐÐÔËÐÐʱԪÊý¾Ý·ÃÎÊ£¬Ò»Ö±µ½ÔÚÔËÐÐʱÐ޸ĺ͹¹ÔìÐÂÀà¡£¹á´©ÕûƪÎÄÕµĹ«¹²ÏßË÷ÊÇÕâÑùÒ»ÖÖ˼Ï룺ÔÚ Java
ƽ̨Éϱà³ÌÒª±ÈʹÓÃÖ±½Ó±àÒë³É±¾»ú´úÂëµÄÓïÑÔ¸ü¾ß¶¯Ì¬ÐÔ¡£Èç¹ûÄúÀí½âÁËÕâЩ¶¯Ì¬·½Ã棬¾Í¿ÉÒÔʹÓà Java
±à³ÌÍê³ÉÄÇЩÔÚÈκÎÆäËüÖ÷Á÷±à³ÌÓïÑÔÖв»ÄÜÍê³ÉµÄÊÂÇé¡£
±¾ÎÄÖУ¬ÎÒ½«ÌÖÂÛһЩ»ù±¾¸ÅÄËüÃÇÊÇÕâЩ Java ƽ̨¶¯Ì¬ÌØÐԵĻù´¡¡£ÕâЩ¸ÅÄîµÄºËÐÄÊÇÓÃÓÚ±íʾ
Java ÀàµÄ¶þ½øÖƸñʽ£¬°üÀ¨ÕâЩÀà×°Èëµ½ JVM ʱËù·¢ÉúµÄÇé¿ö¡£±¾ÎIJ»½öÊDZ¾ÏµÁÐÆäÓ༸ƪÎÄÕµĻù´¡£¬¶øÇÒ»¹ÑÝʾÁË¿ª·¢ÈËÔ±ÔÚʹÓà Java
ƽ̨ʱÅöµ½µÄһЩ·Ç³£Êµ¼ÊµÄÎÊÌâ¡£
Óöþ½øÖƱíʾµÄÀà
ʹÓà Java ÓïÑԵĿª·¢ÈËÔ±ÔÚÓñàÒëÆ÷±àÒëËûÃǵÄÔ´´úÂëʱ£¬Í¨³£²»±Ø¹ØÐĶÔÕâЩԴ´úÂë×öÁËЩʲôÕâÑùµÄϸ½Ú¡£µ«ÊDZ¾ÏµÁÐÎÄÕÂÖУ¬ÎÒ½«ÌÖÂÛ´ÓÔ´´úÂëµ½Ö´ÐгÌÐòËùÉæ¼°µÄÐí¶àÄ»ºóϸ½Ú£¬Òò´ËÎÒ½«Ê×ÏÈ̽ÌÖÓɱàÒëÆ÷Éú³ÉµÄ¶þ½øÖÆÀà¡£
¶þ½øÖÆÀà¸ñʽʵ¼ÊÉÏÊÇÓÉ JVM ¹æ·¶¶¨ÒåµÄ¡£Í¨³£ÕâЩÀà±íʾÊÇÓɱàÒëÆ÷´Ó Java ÓïÑÔÔ´´úÂëÉú³ÉµÄ£¬¶øÇÒËüÃÇͨ³£´æ´¢ÔÚÀ©Õ¹ÃûΪ
.class
µÄÎļþÖС£µ«ÊÇ£¬ÕâЩÌØÐÔ¶¼Î޹ؽôÒª¡£ÒѾ¿ª·¢ÁË¿ÉÒÔʹÓà Java ¶þ½øÖÆÀà¸ñʽµÄÆäËüһЩ±à³ÌÓïÑÔ£¬¶øÇÒ³öÓÚijЩĿµÄ£¬»¹¹¹½¨ÁËеÄÀà±íʾ£¬²¢±»Á¢¼´×°Èëµ½ÔËÐÐÖÐµÄ JVM¡£¾Í JVM ¶øÑÔ£¬ÖØÒªµÄ²¿·Ö²»ÊÇÔ´´úÂëÒÔ¼°ÈçºÎ´æ´¢Ô´´úÂ룬¶øÊǸñʽ±¾Éí¡£
ÄÇôÕâ¸öÀà¸ñʽʵ¼Ê¿´ÉÏÈ¥ÊÇʲôÑùÄØ£¿Çåµ¥ 1 ÌṩÁËÒ»¸ö£¨·Ç³££©¼ò¶ÌµÄÀàµÄÔ´´úÂ룬»¹¸½´øÁËÓɱàÒëÆ÷Êä³öµÄÀàÎļþµÄ²¿·ÖÊ®Áù½øÖÆÏÔʾ£º
Çåµ¥ 1. Hello.java µÄÔ´´úÂëºÍ£¨²¿·Ö£©¶þ½øÖÆÀàÎļþ
public class Hello
{
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
0000: cafe babe 0000 002e 001a 0a00 0600 0c09 ................
0010: 000d 000e 0800 0f0a 0010 0
Ïà¹ØÎĵµ£º
¸ÕÔÚÒ»¸ö½Ð51ctoµÄÍøÕ¾¿´µ½µÄ£¬¸Ð¾õÕâ¸çÃÇ×ܽáµÄ±È½ÏÈ«ÁË£¬Àý×Ó¶¼ºÜ¼òµ¥£¬¶¼ÄÜ˵Ã÷ÎÊÌâ¡£Êղأ¬ºÇºÇ¡£
»¹ÓоÍÊǼ¯ºÏÀïÓõĵü´úÆ÷Ò²ÊÇÄÚ²¿ÀàµÄÉè¼Æ£¬ÎÒÒ²¾ÍÖªµÀÕâÒ»¸ö£¬¹þ¹þ¡£
ÒÔÏÂΪÔÎÄ£º
¶ÔÓÚJavaÄÚ²¿À࣬´ó¼Òʵ¼ÊÉÏÁ˽ⲻ¶à¡£ÔÚÕâÀïÎÒÃÇÒÔʵ¼Ê´úÂëµÄÐÎʽ£¬Îª´ó¼ÒÏêϸ½éÉÜJavaÄÚ²¿ÀàÔÚGUIÉè¼ÆµÄ×÷Óá£
JavaÄÚ²¿ÀàÆäʵ ......
¹þ¹þ,½ñÌìûÊÂ×ö,µ«ÐÄÇé²»´í,ËùÒÔдÕâƪÎÄÕÂ.
Àà×°ÔØÆ÷ÊÇJava³ÌÐòÔËÐÐʱ²»¿ÉȱÉÙµÄÒ»²¿·Ö,ËüµÄÈÎÎñÊÇ°ÑÓÉJavaÔ´³ÌÐò±àÒë³ÉµÄclassÎļþ¶ÁÈëµ½ÄÚ´æÖÐ,È·ÇеÄ˵ÊÇ×°Èëµ½JVMµÄÄÚ´æÖÐ,ӦΪJVMÊÇһ̨³éÏóµÄ¼ÆËã»ú,ËüÓÐ×Å×Ô¼ºµÄCPU,ÄÚ´æµÈ. ÔÚclassÎļþÖаüº¬ÁËÒ»¸öÀàµÄ¸÷ÖÖÐÅÏ¢,µ±Ö´ÐÐjava XXXÃü ......
ÕâÁ½Ìì×ÜÊÇתÌû×ÓÁË£¬²»¹ý¿´¹ýºó£¬ÎÒÊÜÒæ·Ëdz£¡£¡
javaÖÐÖØдºÍÖع¹¶þÕߵĶ¨ÒåºÍÇø±ð£¿
Öع¹¿É²»ÊÇ“ÖØÔع¹Ô캯Êý”µÄ¼òд¡£
Èí¼þÖع¹ºÍÖØдѹ¸ù²»ÊÇÒ»¸ö²ã´ÎÉϵĶ«Î÷£¡
Èí¼þÖع¹ÊÇ˵³ÌÐòԱΪÁË¶Ô ÒÑÓгÌÐòÔÚ¾¡Á¿²»¸Ä±ä½Ó¿ÚµÄÇ°ÌáÏ ½øÐÐÈçÏ´¦Àí ¶ø×öµÄ ÖØбàд´úÂëµÄ¹¤×÷
1¡¢È¥³ýbug
2¡¢Ìá¸ßЧ ......
ÏîÄ¿ÖÐÐèÒªºÍµÚÈý·½Æ½Ì¨½Ó¿Ú£¬¼ÓÁËÀ´Ô´IP¼øȨ¹¦ÄÜ£¬²âÊÔʱ·¢ÏÖûÓÐÎÊÌ⣬µ«ÊDz¿ÊðÒÔºó·¢ÏÖ´æÔÚÎÊÌ⣬һֱ¼øȨ²»Í¨¹ý£¬Ò»ÈºÈËץϹ¡£
ÎÒÕÒµ½ÄÇ¿éµÄ´úÂ룬¸úÁËÒ»±éÁ÷³Ì·¢ÏÖÂ߼ûÓÐɶÎÊÌ⣬µ«ÊÇ×îÖյĽá¹ûÈ´»¹ÊǼøȨ²»Í¨¹ý£¬ÊµÔÚÓÐЩ¹îÒì¡£Æä»ù±¾Â߼ΪÏÈÈ¡µÃÅäÖõÄIPÁÐ±í£¬È»ºóͨ¹ýrequest.getRemoteAddr()È¡µÃ¿Í»§¶ËµÄIPµ ......
package com;
import java.util.*;
public class WhatDay {
public static void main(String[] args) {
Calendar c = Calendar.getInstance();
c.setTime(new Date(System.currentTimeMillis()));
int dayOfWeek = c.get(Calendar.DAY_OF_WEEK);
switch (dayOfWeek) {
ca ......