Éî¿ÌÀí½âJava±à³ÌµÄ7¸öÀý×Ó
1. ÔĶÁÏÂÁдúÂë»Ø´ðÎÊÌ⣨µÚÒ»¸öJava³ÌÐò£¬Àí½âPATHºÍCLASSPATH£¬Ñ§»áʹÓÃjavacºÍjavaÃüÁ
view plaincopy to clipboardprint?
package cn.edu.uibe;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
package cn.edu.uibe;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
ÎÊ£º
£¨1)ÉÏÃæ´úÂëËùÔÚµÄÔ´ÎļþµÄÎļþÃûÊÇ_______________£¿
£¨2£©ÔÚDOSÌáʾ·ûÏ£¬µ±Ç°Ä¿Â¼Îª¸ÃÔ´ÎļþËùÔÚµÄĿ¼£¬PATH»·¾³±äÁ¿ÒÑ°üº¬±àÒë³ÌÐòËùÔڵķ¾¶£¬±àÒëÄ¿±ê·¾¶Îª“D:\classes”£¬±àÒëÃüÁîÐÐÊÇ_____________£¿
£¨3£©ÎªÁËÈÃJava½âÊÍÆ÷Äܹ»ÕÒµ½±àÒëºóµÄÀàÎļþ£¬ÐèÒªÈçºÎÉèÖû·¾³±äÁ¿___________£¿
£¨4£©ÔÚÕýÈ·ÉèÖÃÁËÏà¹ØµÄ»·¾³±äÁ¿Ö®ºó£¬ÔËÐÐHelloWorldÀàµÄÃüÁîÐÐÊÇ____________?
´ð°¸£º
£¨1£©HelloWorld.java£¬¹«¹²Àà±ØÐ붨ÒåÔÚºÍÀàÃûͬÃûµÄÎļþÖУ¬ÎļþÃûÇø·Ö´óСд¡£
£¨2£©javac -d D:\classes HelloWorld.java £¬-d¸ø³öÊä³öĿ¼£¬javac»áÔÚD:\classes´´½¨°üµÄĿ¼²ã´Î½á¹¹cn\edu\uibe\HelloWorld.class
£¨3£©set CLASSPATH=.;D:\classses£¬CLASSSPATH¸ø³öJavaÑ°ÕÒ.classÎļþµÄ¶à¸ö·¾¶£¬Â·¾¶Ö®¼äÓ÷ֺŷָô£¬“.”±íʾµ±Ç°Â·¾¶¡£
£¨4£©java cn.edu.uibe.HelloWorld£¬×¢ÒâÐèÒª¸ø³ö°üÃû£¬ÀàÃûºóÃæ²»Òª¼Ó“.class”¡£
2. ÔĶÁÏÂÁдúÂë»Ø´ðÎÊÌ⣨¹ØÓÚprivateµÄÀí½â£©
view plaincopy to clipboardprint?
public class Light {
private int brightness = 5;
public void brighten(Light another){
another.brightness++;
}
public static void main(String[] args) {
Light light1 = new Light();
&nb
Ïà¹ØÎĵµ£º
ÔËÐÐÓ¦ÓóÌÐòÓëÔËÐÐweb³ÌÐòÔÀíÊÇÒ»Öµģ¬Ö»²»¹ýwebÓ¦ÓóÌÐòÒѾÔÚÆô¶¯Ê±½«³ÌÐòÔËÓõÄjar°üÉèÖõ½»·¾³±äÁ¿ÀӦÓóÌÐò¿ÉÒÔ×Ô¼ºÐ´¸öÅú´¦ÀíÀ´ÉèÖû·¾³±äÁ¿£º
java -classpath ./lib/application.jar;./lib/hibernate3.jar -Xms608m -Xmx608m com.zyj.application.StartUp
pause/exit
ÆäÖÐapplication.jarΪӦÓóÌÐòµÄjar° ......
1.1 ²»ÓÃnew¹Ø¼ü´Ê´´½¨ÀàµÄʵÀý
ÓÃnew¹Ø¼ü´Ê´´½¨ÀàµÄʵÀýʱ£¬¹¹Ô캯ÊýÁ´ÖеÄËùÓй¹Ô캯Êý¶¼»á±»×Ô¶¯µ÷Óᣵ«Èç¹ûÒ»¸ö¶ÔÏóʵÏÖÁËCloneable½Ó¿Ú£¬ÎÒÃÇ¿ÉÒÔµ÷ÓÃËüµÄclone()·½·¨¡£clone()·½·¨²»»áµ÷ÓÃÈκÎÀ๹Ô캯Êý¡£
ÔÚʹÓÃÉè¼Æģʽ£¨Design Pattern£©µÄ³¡ºÏ£¬Èç¹ûÓÃFactoryģʽ´´½¨¶ÔÏó£¬Ôò¸ÄÓÃclone()·½·¨´´½¨Ðµ ......
package com.chinacache.utils;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
public class FileUtils {
private static final Logger logger = Logger.getLogger(FileUtils.class);
/**
* Òƶ¯Îļþµ½Ö¸¶¨Ä¿ ......
ËùÓеijÌÐò¿ª·¢Êֲᶼ°üº¬Á˸÷ÖÖ¹æÔò¡£Ò»Ð©Ï°¹ß×ÔÓɳÌÐòÈËÔ±¿ÉÄܶÔÕâЩ¹æÔòºÜ²»ÊÊÓ¦£¬µ«ÊÇÔÚ¶à¸ö¿ª·¢ÈËÔ±¹²Í¬Ð´×÷µÄÇé¿öÏ£¬ÕâЩ¹æÔòÊDZØÐèµÄ¡£Õâ²»½ö½ö
ÊÇΪÁË¿ª·¢Ð§ÂÊÀ´¿¼ÂÇ£¬¶øÇÒÒ²ÊÇΪÁ˺óÆÚά»¤¿¼ÂÇ¡£
ÃüÃû¹æ·¶
¶¨ÒåÕâ¸ö¹æ·¶µÄÄ¿µÄÊÇÈÃÏîÄ¿ÖÐËùÓеÄÎĵµ¶¼¿´ÆðÀ´ÏñÒ»¸öÈËдµÄ£¬Ôö¼Ó¿É¶ÁÐÔ£¬¼õÉÙÏîÄ¿×éÖ ......