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

java£º¶þ·Ö²éÕÒ·¨

package arrays.compara;
/**
 *
 * @author Happy ¶þ·Ö²éÕÒ·¨
 */
public class BinarySearch {
 public static void main(String[] args) {
  int[] arrInt = { 2, 34, 32, 24, 23, 34, 12, 3, 4, 2 };
  int index = bSearch(29, arrInt, 0, arrInt.length);
  System.out.println("Index : " + index);
  /*
   * for (int i : arrInt) { System.out.println(i); }
   */
 }
 // js¶þ·Ö²éÕÒ·¨£¨Ã»Óгɹ¦£©
 private static int bSerarch(int[] arrInt, int value) {
  int startIndex = 0, stopIndex = arrInt.length - 1, middle = (int) (Math
    .floor((stopIndex + startIndex) / 2));
  while (arrInt[middle] != value && startIndex < stopIndex) {
   // adjust search area£¨µ÷Õû²éÕÒ·¶Î§£©
   if (value < arrInt[middle]) {
    stopIndex = middle - 1;
   } else if (value > arrInt[middle]) {
    startIndex = middle + 1;
   }
   // recalculate middle£¨ÖØмÆËãÖÐÏîË÷Òý£©
   middle = (int) Math.floor((stopIndex + startIndex) / 2);
  }
  // make sure it's the right value£¨È·±£·µ»ØÕýÈ·µÄÖµ£©
  return (arrInt[middle] != value) ? -1 : middle;
 }
 // java¶þ·Ö²éÕÒ·¨
 private static void bSearch(int[] arrInt, int seek) {
  // Òª²éÕÒµÄÖµ
  // int seek = 33;
  // ÀàËÆÓÚÖ¸ÕëµÄ¶«Î÷
  int index = 0;
  // ²éÕÒÆðʼϱê
  int start = 0;
  // ²éÕÒ½áÊøϱê
  int end = arrInt.length - 1;
  // ¼ÆÊýÆ÷
  int count = 0;
  while (true) {
   count++;
   // ³õʼ»¯Êý×éÖмäÖµµÄϱê
   // Ô­À´Îªindex = (start + end) / 2;µ±start + endµÄÖµ³¬¹ýÁË×î´óµÄÕýintÖµµÄʱºò, index
   // »á±ä³É¸ºÖµ,Õâ¸öʱºò¾Í»áÅ׳öÒì³£


Ïà¹ØÎĵµ£º

JavaÖм¯ºÏÈÝÆ÷ÀàListºÍSetµÄÓ÷¨

ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1  List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......

´«ÖDz¥¿ÍJAVAÅàѵOAÏîÄ¿ ÉóÅúÁ÷תģ¿é¶þ


´«ÖDz¥¿ÍJAVAÅàѵOAÏîÄ¿ ÉóÅúÁ÷תģ¿é¶þ
ËäÈ»ÕâÁ½ÌìѧϰµÄ֪ʶµãÊÇspring£¬µ«ÊÇÎҵĹ۵ã¾ÍÊÇѧһ¸ö֪ʶµã¾ÍҪѧͨ°É£¬ÒòΪÈç¹ûÇ°ÃæµÄ֪ʶ¶¼Ã»ÓÐѧ»á£¬ÓÖ¼±×ÅȥѧϰеĶ«Î÷£¬Ö»»áÇ·ÏÂÔ½À´Ô½¶àµÄ¶«Î÷£¡ÕâÒ²ÊÇÎÒѧϰµÄÖ÷ÕÅ¡£ËµÊµÔڵģ¬ÉÏÒ»¸öÏîÄ¿OAÏîÄ¿µÄ¶¼Ã»ÓÐÀí½âµÃ͸³¹£¬¾Í¼±×Åȥѧ£¬Ö»»áÔ½À´Ô½´óµÄѹÁ¦£¬Ô½À´Ô½Ã» ......

java Annotation Æ´×°SQLÓï¾ä

ÉùÃ÷×Ö¶ÎÓ³Éä
@Target(ElementType.FIELD)  
@Retention(RetentionPolicy.RUNTIME) 
public @interface FiledRef
{
    String fieldName();
}
ÉùÃ÷±íÓ³Éä
@Target(ElementType.TYPE)  
@Retention(RetentionPolicy.RUNTIME)
public @interface TableRef
{
 & ......

Java´®¿Ú±à³Ì1

    ¹«Ë¾Óõ½´®¿Ú±à³Ì£¬¹Ê¿ªÊ¼Ñо¿£¬Ê×ÏÈËѵ½µÄÊÇjavacomm20-win32.zipÕâ¸öѹËõ°ü£¬°´ÕÕÍøÉϵݲװÅäÖúã¬ÈçÏ£º
    API
    ÔÚjavax.commÏÂÓÐ13¸öÀàºÍ½Ó¿Ú£¬·Ö±ðÊÇ
    4¸ö½Ó¿Ú
    CommDriver ¿É¸ºÔØÉ豸£¨the loadable device£©Çý¶¯³ ......

Java Class Version Ñо¿



Ò»£ºÒª½â¾öµÄÎÊÌâ




ÎÒÃÇÔÚ³¢ÏÊ JDK1.5 µÄʱºò£¬ÏàÐŲ»ÉÙÈËÓöµ½¹ý Unsupported major.minor version 49.0
´íÎ󣬵±Ê±¶¨»áãȻ²»ÖªËù´ë¡£ÒòΪ¸Õ¿ªÊ¼ÄÇ»á¶ù£¬ÍøÉÏÓë´ËÏà¹ØµÄÖÐÎÄ×ÊÁÏ»¹²»¶à£¬ÏÖÔÚºÃÁË£¬ÍøÉÏÒ»ÕÒ¾ÍÖªµÀÊÇÈçºÎ½â¾ö£¬´ó¶à»á¸æËßÄãҪʹÓà JDK
1.4 ÖØбàÒë¡£ÄÇôÖÁÓÚΪʲô£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ