Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javaµÚ9Ìì´úÂ루¼¯ºÏÀࣩ

/**********Customer .java   begin***********/
import java.util.HashSet;
import java.util.Set;
/**
 * Èç¹ûÁ½¸öCustomer¶ÔÏónamaÊôÐÔºÍageÊôÐÔÏàͬ£¬ÄÇôÕâÁ½¸öCustomer¶ÔÏóÏàµÈ¡£
 * @author Administrator
 *
 */
public class Customer {
 
 private String name;
 
 private int age;
 public String getName() {
  return name;
 }
 public int getAge() {
  return age;
 }
 public void setName(String name) {
  this.name = name;
 }
 public void setAge(int age) {
  this.age = age;
 }
 public Customer(String name, int age) {
  super();
  this.name = name;
  this.age = age;
 }
 
 public Customer(){}
    /**
     * Èç¹ûCustomerÀา¸ÇÁËObjectÀàÖеÄequals·½·¨£¬µ«Ã»Óи²¸ÇObjectÖеÄHashCode·½·¨£¬
     * ¾Í»áµ¼Öµ±Customer1.equals.(Customer2)Ϊtrueʱ£¬¶øCustomer1ºÍCustomer2µÄ¹þ
     * Ï£Âë²»Ò»¶¨Ò»Ñù£¬¾Í»áʹHashSetÎÞ·¨¹¤×÷¡£
     */
 @Override
 public boolean equals(Object obj) {
  if((obj instanceof Customer)){
   Customer other=(Customer) obj;
   if(this.name.equals(other.getName()) && this.age==other.getAge()) {
    return true;
   }
  }
  return false;
  
 }
 /**
  * ΪÁ˱£Ö¤HashSetµÄÕý³£¹¤×÷£¬Èç¹ûCustomerÀา¸ÇÁËequals·½·¨£¬Í¬Ê±Ò²Ó¦¸ÃÈ¥¸²¸ÇhashCode
  * ·½·¨£¬²¢ÇÒ±£Ö¤Á½¸öÏàµÈ¶ÔÏóµÄ¹þÏ£ÂëÒ²ÊÇÒ»Ñù¡£
  */
// @Override
 public int hashCode() {
  int result;
  result=(name==null?0:name.hashCode());
  result=result+age;
  return result;
 }
 
    public static void main(String args[]){
     Set set=new HashSet();
  &nb


Ïà¹ØÎĵµ£º

java£¬or c++/c Ñ¡Ôñ

Ò»Ö±¶¼¸Ðµ½ºÜÃÔ㣬¶ÔÓÚÓïÑÔµÄÑ¡Ôñ£¬ÒòΪ»¹ÊDzËÄñµÄÔ­Òò£¬ÎÞ·¨¿´Í¸ÀïÃæµÄÖÖÖÖ¹ØÏµ£¬Ò»Ö±ÔÚ¾À½áÆäÖС£Æäʵ×Ô¼ºÒ²Ã÷°×“´óµÀÖÁ¼ò”£¬µ«»¹Êǰ´ÄͲ»×¡¿ñÏëµÄ˼Ð÷£¬ÌرðÊǵ±´Ó¹«Ë¾³ö²î»ØÀ´Ö®ºó£¬¼¸Ì춼ûÓÐ×öʲôÊÂÇé¡£
¶ÔCÓÐÒ»ÖÖÆ«ºÃ£¬ËùÒÔÒ»Ö±ÔÚÐÄÀï¾ÍÓеãÅųâjava¡£ËäÈ»javaÖÐÒ²ÓкܶණÎ÷Ҫѧ£¬µ«ÊÇDZÒâʶÀïÃæ¶ÔÕ ......

javaÓëSQLÊý¾Ý¿âÇŽӷ½Ê½Ò×´íÎÊÌâÓëÉè¼ÆºËÐÄ

 ÎÄÕÂÔ­´´£¬×ªÔØÇëÓëBlogÖ÷ÈËÁªÏµ£¬robin9257@hotmail.com
JAVAÓëSQLÇŽӵÄÓÅȱµã£º
1¡¢Óŵ㣺²»ÓÃÏÂÔØÇý¶¯³ÌÐò£¬ÔÊÐíÓÃÏàͬ´úÂë·ÃÎʲ»Í¬DBMS¡£
2¡¢È±µã£ºÐ§Âʵ͡£
¾­³£³öÏֵı¨´íµã£º
1¡¢java.sql.SQLException: [Microsoft][ODBC Çý¶¯³ÌÐò¹ÜÀíÆ÷] δ·¢ÏÖÊý¾ÝÔ´Ãû³Æ²¢ÇÒδָ¶¨Ä¬ÈÏÇý¶¯³ÌÐò
  
&nbs ......

´óѧJAVAʵÑéÎå


´óѧJAVAʵÑéÎå
 
ÕâÒ»´ÎµÄʵÑé×öµÄ²»ÂúÒ⣬¿ÒÇë¸÷λÅúÆÀ£¬¿ÒÇë¸÷λÌṩ·½·¨¼°½¨Òé
 
µÚÒ»¸öʵÑé
 
Ö¸¶¨²»Í¬Ð­ÒéµÄURLµØÖ·£¬»ñµÃ×ÊÔ´ÎļþµÄÄÚÈݺÍÊôÐÔ
URLStudy.java
package first;
import java.awt.FileDialog;
import java.awt.Font;
import java.awt.TextArea;
import java.io.FileWriter ......

Éî¿ÌÀí½âJava±à³ÌµÄ7¸öÀý×Ó

 Éî¿ÌÀí½âJava±à³ÌµÄ7¸öÀý×Ó   Ù¡Ç¿ 2009Äê11ÔÂ7ÈÕ http://blog.csdn.net/microtong
 1. ÔĶÁÏÂÁдúÂë»Ø´ðÎÊÌ⣨µÚÒ»¸öJava³ÌÐò£¬Àí½âPATHºÍCLASSPATH£¬Ñ§»áʹÓÃjavacºÍjavaÃüÁ
view plaincopy to clipboardprint?
package cn.edu.uibe;  
public class HelloWorld {  
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ