javaÖеÄÖµ´«µÝºÍÒýÓô«µÝ
Öµ´«µÝ£º·½·¨µ÷ÓÃʱ£¬Êµ¼Ê²ÎÊý°ÑËüµÄÖµ´«µÝ¸ø¶ÔÓ¦µÄÐÎʽ²ÎÊý£¬·½·¨Ö´ÐÐÖÐÐÎʽ²ÎÊýÖµµÄ¸Ä±ä²»Ó°Ïìʵ¼Ê²Î ÊýµÄÖµ¡£
ÒýÓô«µÝ£ºÒ²³ÆΪ´«µØÖ·¡£·½·¨µ÷ÓÃʱ£¬Êµ¼Ê²ÎÊýµÄÒýÓÃ(µØÖ·£¬¶ø²»ÊDzÎÊýµÄÖµ)±»´«µÝ¸ø·½·¨ÖÐÏà¶ÔÓ¦µÄÐÎʽ²ÎÊý£¬ÔÚ·½·¨Ö´ÐÐÖУ¬¶ÔÐÎʽ²ÎÊýµÄ²Ù×÷ʵ¼ÊÉϾÍÊǶÔʵ¼Ê²ÎÊýµÄ²Ù×÷£¬·½·¨Ö´ÐÐÖÐÐÎʽ²ÎÊýÖµµÄ¸Ä±ä½«»áÓ°Ïìʵ¼Ê²ÎÊýµÄÖµ¡£
ÏÂÃæ¾ÙÀý˵Ã÷£º
´«Öµ---´«µÝ»ù±¾Êý¾ÝÀàÐͲÎÊý
public class PassValue{
static void exchange(int a, int b){//¾²Ì¬·½·¨£¬½»»»a,bµÄÖµ
int temp;
temp = a;
a = b;
b = temp;
}
public static void main(String[] args){
int i = 10;
int j = 100;
System.out.println("before call: " + "i=" + i + "\t" + "j = " + j);//µ÷ÓÃÇ°
exchange(i, j); //Öµ´«µÝ£¬main·½·¨Ö»Äܵ÷Óþ²Ì¬·½·¨
System.out.println("after call: " + "i=" + i + "\t" + "j = " + j);//µ÷Óúó
}
}
ÔËÐнá¹û£º
before call: i = 10 j = 100
after call: i = 10 j = 100
˵Ã÷£ºµ÷ÓÃexchange(i, j)ʱ£¬Êµ¼Ê²ÎÊýi£¬j·Ö±ð°ÑÖµ´«µÝ¸øÏàÓ¦µÄÐÎʽ²ÎÊýa£¬b,ÔÚÖ´Ðз½·¨exchange()ʱ£¬ÐÎʽ²ÎÊýa£¬bµÄÖµµÄ¸Ä±ä²»Ó°Ïìʵ¼Ê²ÎÊýiºÍjµÄÖµ£¬iºÍjµÄÖµÔÚµ÷ÓÃÇ°ºó²¢Ã»¸Ä±ä¡£
ÒýÓô«µÝ---¶ÔÏó×÷Ϊ²ÎÊý
Èç¹ûÔÚ·½·¨ÖаѶÔÏ󣨻òÊý×飩×÷Ϊ²ÎÊý£¬·½·¨µ÷ÓÃʱ£¬²ÎÊý´«µÝµÄÊǶÔÏóµÄÒýÓ㨵ØÖ·£©£¬¼´ÔÚ·½·¨µ÷ÓÃʱ£¬Êµ¼Ê²ÎÊý°Ñ¶Ô¶ÔÏóµÄÒýÓ㨵ØÖ·£©´«µÝ¸øÐÎʽ²ÎÊý¡£ÕâÊÇʵ¼Ê²ÎÊýÓëÐÎʽ²ÎÊýÖ¸Ïòͬһ¸öµØÖ·£¬¼´Í¬Ò»¸ö¶ÔÏó£¨Êý×飩£¬·½·¨Ö´ÐÐʱ£¬¶ÔÐÎʽ²ÎÊýµÄ¸Ä±äʵ¼ÊÉϾÍÊǶÔʵ¼Ê²ÎÊýµÄ¸Ä±ä£¬Õâ¸ö½á¹ûÔÚµ÷ÓýáÊøºó±»±£ÁôÁËÏÂÀ´¡£
class Book{
String name;
private folat price;
Book(String n, float ){ //¹¹Ôì·½·¨
name = n;
price = p;
}
static void change(Book a_book, String n, float p){ //¾²Ì¬·½·¨£¬¶ÔÏó×÷Ϊ²ÎÊý
a_book.name = n
Ïà¹ØÎĵµ£º
Executing a CommandSee also e90 Reading Output from a Command.
try {
// Execute a command without arguments
String command = "ls";
Process child = Runtime.getRuntime().exec(command);
// Execute a command with an argument
command = "ls /tmp"; ......
Hibernate Ö®¸¸ Gavin King[1]½¨Ò鿪·¢ÕßÉý¼¶µ½ Java EE 6 ƽ̨£¬²¢Ö¸³ö£¬Ä¿Ç°¸÷ÖÖ²»Ô¸ÒâÉý¼¶µÄ¹ÛµãÆäʵÊÇûÓиù¾ÝµÄ¡£
Java EE 6 ·¢²¼ºó£¬ÎÒ¿´µ½Á˺ܶ෴¶ÔÉý¼¶µ½ÐÂƽ̨µÄ¹Ûµã¡£ÕâЩ·´¶Ô¹Ûµã´ó¶àÊÇÓÉ Tomcat / Jetty ÒÔ¼°Ò»Ð©¿ªÔ´¿ò¼Ü£¨ÀýÈç Hibernate Óë Spring£©µÄʹÓÃÕßÌá³ö¡£
µ±È»£¬Ñ¡Ôñ·Ç±ê×¼¡¢¿ªÔ´¼¼ÊõÓкܶàºÃ´¦¡ ......
Ãô½Ý¿ª·¢Öбàд¸ßÖÊÁ¿Java´úÂë
2010-03-08 10:32
|
1709
´ÎÔĶÁ
|
¡¾ÒÑÓÐ9
ÌõÆÀÂÛ¡¿·¢±íÆÀÂÛ
À´Ô´£º±ÈÌØÍø À´Ô´£ºIBM/ÍõÓÀ¿ý
|
Êղص½ÎÒµÄÍøÕª
Ãô½Ý¿ª·¢µÄÀíÄîÒѾÁ÷ÐÐÁ˺ܳ¤µÄʱ¼ä£¬ÔÚÃô½Ý¿ª·¢ÖеĿª·¢µü´ú½×¶ÎÖУ¬ÎÒÃÇ¿ÉÒÔͨ¹ýÎå¸ö²½Ö裬À´ÓÐЧµÄÌá¸ßÕû¸öÏîÄ¿µÄ´úÂëÖÊÁ¿¡ ......
½«´«ÈëµÄÈÎÒâÖÐÎÄ×Ö·ûת»»ÎªÆ´Òô
£¨1£©¶àÒô×ÖֻȡÆäÖÐÒ»¸ö¶ÁÒô¡£
£¨2£©ÉúƧ×ÖÈç¹ûûÓÐÆ´Òô£¬Ê¹ÓÃunknownÌæ´ú¡£
package com.amgotech;
public class ChineseSpelling
{
private static int[] pyvalue = new int[] { -20319, -20317, -20304, -20295, -20292, -20283, -20265, -20257, -20242, -20 ......