亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? 數(shù)組.txt

?? 適合初學(xué)者練習(xí) 包括awt小程序、list和map群體等100多個java程序
?? TXT
字號:
數(shù)組 List.1 ArrayBounds/ArrayBounds.java 
數(shù)組 List.2 Triangle/Triangle.java 
數(shù)組 List.3 ObjectArray/ObjectArray.java 
數(shù)組 List.4 ArrayCopy/ArrayCopy.java 
數(shù)組 List.5 ArrayCopy/TestClass.java 
數(shù)組 List.6 ArraysSort.txt 
數(shù)組 List.7 SortStrings/SortStrings.java 
數(shù)組 List.8 SortObjects/SortObjects.java 
數(shù)組 List.9 SortComparator/SortComparator.java 
數(shù)組 List.10 ArraysSearch.txt 
數(shù)組 List.11 ArraysEqual.txt 
數(shù)組 List.12 ArraysFill.txt 
數(shù)組 List.13 ArraysList.txt 
數(shù)組 List.14 ArraysList/ArraysList.java 

--------------------------------------------------------------------------------

數(shù)組 List.1 ArrayBounds/ArrayBounds.java 
Return to top 
001: class ArrayBounds {
002:  public static void main(String args[]) {
003:   int intArray[] = new int[10]; // Create array
004:   try {
005:    int q = intArray[5];   // no error
006:    int p = intArray[11];  // throws exception
007:   } catch (ArrayIndexOutOfBoundsException e) {
008:    System.out.println("Array index out of bounds");
009:   }
010:  }
011: }

Return to top 
--------------------------------------------------------------------------------

數(shù)組 List.2 Triangle/Triangle.java 
Return to top 
001: class Triangle {
002:  public static void main(String args[]) {
003:   // Create a triangular array
004:   int triangular[][];
005:   triangular = new int[8][];
006:   for (int i = 0; i < triangular.length; i++)
007:    triangular[i] = new int[i + 1];
008: 
009:   // Assign values at random to the array
010:   for (int i = 0; i < triangular.length; i++)
011:    for (int j = 0; j < triangular[i].length; j++)
012:     triangular[i][j] = (int)(Math.random() * 100);
013: 
014:   // Display the array's contents
015:   for (int i = 0; i < triangular.length; i++) {
016:    for (int j = 0; j < triangular[i].length; j++)
017:     System.out.print(" /t" + triangular[i][j]);
018:    System.out.println();
019:   }
020:  }
021: }

Return to top 
--------------------------------------------------------------------------------

數(shù)組 List.3 ObjectArray/ObjectArray.java 
Return to top 
001: class StringClass {
002:  private String s;
003:  // Constructor
004:  StringClass(String s) { 
005:   this.s = s; 
006:  }
007:  void ShowString() {
008:   System.out.println(s);
009:  }
010: }
011: 
012: class ObjectArray {
013:  public static void main(String args[]) {
014:   // Construct an array of class objects
015:    StringClass WeekDays[] = {
016:     new StringClass("Domingo"),
017:     new StringClass("Lunes"),
018:     new StringClass("Martes"),
019:     new StringClass("Miercoles"),
020:     new StringClass("Jueves"),
021:     new StringClass("Viernes"),
022:     new StringClass("Sabado")
023:    };
024:   // Call a method for each arrayed object
025:   System.out.println("Weekdays in Spanish");
026:   for (int i = 0; i < WeekDays.length; i++)
027:    WeekDays[i].ShowString();
028:  }
029: }

Return to top 
--------------------------------------------------------------------------------

數(shù)組 List.4 ArrayCopy/ArrayCopy.java 
Return to top 
001: import TestClass;  // Import submodule
002: 
003: class ArrayCopy {
004:  // Declare the two arrays
005:  public static int[] apples, oranges;
006: 
007:   // Array copy method #1
008:  public static void CopyMethod1() {
009:   System.out.println("/nArray copy method #1");
010:   oranges = apples;
011: // oranges[0]++;    // Enable to change test
012:   TestClass.CompareArrays(apples, oranges);
013:  }
014: 
015:  // Array copy method #2
016:  public static void CopyMethod2() {
017:   System.out.println("/nArray copy method #2");
018:   oranges = new int[apples.length];
019:   System.arraycopy(apples, 0, oranges, 0, apples.length);
020:  oranges[0]++;    // Enable to change test
021:   TestClass.CompareArrays(apples, oranges);
022:  }
023: 
024:  // Array copy method #3
025:  public static void CopyMethod3() {
026:   System.out.println("/nArray copy method #3");
027:   oranges = (int[])apples.clone();
028: // oranges[0]++;    // Enable to change test
029:   TestClass.CompareArrays(apples, oranges);
030:  }
031: 
032:  public static void main(String args[]) {
033:   // Construct and initialize the first array
034:   apples = new int[8];
035:   for (int i = 0; i < apples.length; i++)
036:    apples[i] = (int)(Math.random() * 100);
037:   // Copy three ways and test each copy
038:   CopyMethod1();
039:   CopyMethod2();
040:   CopyMethod3();
041:  }
042: }

Return to top 
--------------------------------------------------------------------------------

數(shù)組 List.5 ArrayCopy/TestClass.java 
Return to top 
001: class TestClass {
002:  public static void CompareArrays(int apples[], int oranges[])
003:  {
004:   // Display the array values
005:   int i;
006:   System.out.print("apples : ");
007:   for (i = 0; i < apples.length; i++)
008:    System.out.print(apples[i] + " /t");
009:   System.out.print("/noranges: ");
010:   for (i = 0; i < oranges.length; i++)
011:    System.out.print(oranges[i] + " /t");
012:   System.out.println();  // Start new line
013: 
014:   // Test if the array references are the same
015:   if (apples == oranges)
016:    System.out.println("Array references are identical");
017:   else
018:    System.out.println("Array references are NOT identical");
019: 
020:   // Test if the array contents are the same
021:   boolean identical = true;
022:   for (i = 0; i < apples.length; i++)
023:    if (apples[i] != oranges[i])
024:     identical = false;
025:   if (identical)
026:    System.out.println("Array contents are the same");
027:   else
028:    System.out.println("Array contents are NOT the same");
029:  }
030: }

Return to top 
--------------------------------------------------------------------------------

數(shù)組 List.6 ArraysSort.txt 
Return to top 
001: // Arrays class sorting methods
002: public static void sort(long[] a);
003: public static void sort(long[] a, int fromIndex, int toIndex);
004: public static void sort(int[] a);
005: public static void sort(int[] a, int fromIndex, int toIndex);
006: public static void sort(short[] a);
007: public static void sort(short[] a, int fromIndex, int toIndex);
008: public static void sort(char[] a);
009: public static void sort(char[] a, int fromIndex, int toIndex);
010: public static void sort(byte[] a);
011: public static void sort(byte[] a, int fromIndex, int toIndex);
012: public static void sort(double[] a);
013: public static void sort(double[] a, int fromIndex, int toIndex);
014: public static void sort(float[] a);
015: public static void sort(float[] a, int fromIndex, int toIndex);
016: public static void sort(Object[] a);
017: public static void sort(Object[] a, int fromIndex, int toIndex);
018: public static void sort(Object[] a, Comparator c);
019: public static void sort(Object[] a, int fromIndex, int toIndex, Comparator c);

Return to top 
--------------------------------------------------------------------------------

數(shù)組 List.7 SortStrings/SortStrings.java 
Return to top 
001: import java.util.Arrays;
002: 
003: class SortStrings {
004:  // Display an array of Strings
005:  public static void ShowStrings(String[] a, String msg) {
006:   System.out.println(msg);
007:   for (int i = 0; i < a.length; i++)
008:    System.out.println(a[i]);
009:  }  
010:  // Create, sort, and display an array of StringClass objects
011:  public static void main(String args[]) {
012:   String colors[] = {
013:    "rojo", "azul", "verde", "negro", "blanco", "cafe", "gris"
014:   };
015:   ShowStrings(colors, "/nBefore sorting");
016:   Arrays.sort(colors);
017:   ShowStrings(colors, "/nAfter sorting");  
018:  }
019: }

Return to top 
--------------------------------------------------------------------------------

數(shù)組 List.8 SortObjects/SortObjects.java 
Return to top 
001: import java.util.Arrays;
002: 
003: class StringClass implements Comparable {
004:  private String s;
005:  StringClass(String s) { 
006:   this.s = s; 
007:  }
008:  void ShowString() {
009:   System.out.println(s);
010:  }
011:  public int compareTo(Object other) {
012:   StringClass sc = (StringClass)other;
013:   return s.compareTo(sc.s);
014:  } 
015: }
016: 
017: class SortObjects {
018: 
019:  // Display an array of StringClass objects
020:  public static void ShowStrings(StringClass[] a, String msg) {
021:   System.out.println(msg);
022:   for (int i = 0; i < a.length; i++)
023:    a[i].ShowString();
024:  }  
025: 
026:  // Create, sort, and display an array of StringClass objects
027:  public static void main(String args[]) {
028:   StringClass colors[] = {
029:    new StringClass("rojo"),
030:    new StringClass("azul"),
031:    new StringClass("verde"),
032:    new StringClass("negro"),
033:    new StringClass("blanco"),
034:    new StringClass("cafe"),
035:    new StringClass("gris")
036:   };
037:   ShowStrings(colors, "/nBefore sorting");
038:   Arrays.sort(colors);
039:   ShowStrings(colors, "/nAfter sorting");  
040:  }
041: }

Return to top 
--------------------------------------------------------------------------------

數(shù)組 List.9 SortComparator/SortComparator.java 
Return to top 
001: import java.util.Arrays;
002: import java.util.Comparator;
003: 
004: // Class that implements the Comparator interface
005: class StringCompare implements Comparator {
006:  public int compare(Object o1, Object o2) {
007:   String s1 = (String)o1;
008:   String s2 = (String)o2;
009:   return s1.compareTo(s2);
010:  }
011: }
012: 
013: class SortComparator {
014:  // Display an array of Strings
015:  public static void ShowStrings(String[] a, String msg) {
016:   System.out.println(msg);
017:   for (int i = 0; i < a.length; i++)
018:    System.out.println(a[i]);
019:  }  
020:  // Create, sort, and display an array of StringClass objects
021:  public static void main(String args[]) {
022:   String colors[] = {
023:    "rojo", "azul", "verde", "negro", "blanco", "cafe", "gris"
024:   };
025:   ShowStrings(colors, "/nBefore sorting");
026:   // Construct the Comparator object
027:   StringCompare CompareObject = new StringCompare();
028:   // Sort the array using the Comparator object
029:   Arrays.sort(colors, CompareObject);
030:   ShowStrings(colors, "/nAfter sorting");  
031:  }
032: }

Return to top 
--------------------------------------------------------------------------------

數(shù)組 List.10 ArraysSearch.txt 
Return to top 
001: // Arrays class searching methods
002: public static int binarySearch(long[] a, long key);
003: public static int binarySearch(int[] a, int key);
004: public static int binarySearch(short[] a, short key);
005: public static int binarySearch(char[] a, char key);
006: public static int binarySearch(byte[] a, byte key);
007: public static int binarySearch(double[] a, double key);
008: public static int binarySearch(float[] a, float key);
009: public static int binarySearch(Object[] a, Object key);
010: public static int binarySearch(Object[] a, Object key, Comparator c);

Return to top 
--------------------------------------------------------------------------------

數(shù)組 List.11 ArraysEqual.txt 
Return to top 
001: // Arrays class equality testing methods
002: public static boolean equals(long[] a, long[] a2);
003: public static boolean equals(int[] a, int[] a2);
004: public static boolean equals(short[] a, short a2[]);
005: public static boolean equals(char[] a, char[] a2);
006: public static boolean equals(byte[] a, byte[] a2);
007: public static boolean equals(boolean[] a, boolean[] a2);
008: public static boolean equals(double[] a, double[] a2);
009: public static boolean equals(float[] a, float[] a2);
010: public static boolean equals(Object[] a, Object[] a2);

Return to top 
--------------------------------------------------------------------------------

數(shù)組 List.12 ArraysFill.txt 
Return to top 
001: // Arrays class filling methods
002: public static void fill(long[] a, long val);
003: public static void fill(long[] a, int fromIndex, int toIndex, long val);
004: public static void fill(int[] a, int val);
005: public static void fill(int[] a, int fromIndex, int toIndex, int val);
006: public static void fill(short[] a, short val);
007: public static void fill(short[] a, int fromIndex, int toIndex, short val);
008: public static void fill(char[] a, char val);
009: public static void fill(char[] a, int fromIndex, int toIndex, char val);
010: public static void fill(byte[] a, byte val);
011: public static void fill(byte[] a, int fromIndex, int toIndex, byte val);
012: public static void fill(boolean[] a, boolean val);
013: public static void fill(boolean[] a, int fromIndex, int toIndex, boolean val);
014: public static void fill(double[] a, double val);
015: public static void fill(double[] a, int fromIndex, int toIndex,double val);
016: public static void fill(float[] a, float val);
017: public static void fill(float[] a, int fromIndex, int toIndex, float val);
018: public static void fill(Object[] a, Object val);
019: public static void fill(Object[] a, int fromIndex, int toIndex,Object val);

Return to top 
--------------------------------------------------------------------------------

數(shù)組 List.13 ArraysList.txt 
Return to top 
001: // Arrays class List methods
002: public static List asList(Object[] a);
003:   public int size();
004:   public Object[] toArray();
005:   public Object get(int index);
006:   public Object set(int index, Object element);
007:   public int indexOf(Object o);
008:   public boolean contains(Object o);

Return to top 
--------------------------------------------------------------------------------

數(shù)組 List.14 ArraysList/ArraysList.java 
Return to top 
001: import java.util.Arrays;
002: import java.util.List;
003: 
004: class ArraysList {
005:  public static void main(String args[]) {
006:   // Create array of strings
007:   String fruits[] = {
008:    "apple", "banana", "cherry", "pear"
009:   };
010:   // Convert array to a List object
011:   List fruitList = Arrays.asList(fruits);
012:   // Call various List methods for the array  
013:   int size = fruitList.size();
014:   System.out.println("List size = " + size);
015:   String s = (String)fruitList.get(2);
016:   System.out.println("List element #2 = " + s);
017:   if (fruitList.contains("banana"))
018:    System.out.println("fruitList contains banana");
019:  }
020: }

Return to top 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产婷婷色一区二区三区四区| 国产精一品亚洲二区在线视频| 色噜噜偷拍精品综合在线| 久久久91精品国产一区二区三区| 国产精品一区免费视频| 国产精品你懂的在线欣赏| 成人app网站| 亚洲精选视频免费看| 欧美性受xxxx黑人xyx性爽| 亚洲国产一区二区三区| 91精品蜜臀在线一区尤物| 精品一区二区成人精品| 国产精品色哟哟| 91国偷自产一区二区开放时间 | 欧洲av一区二区嗯嗯嗯啊| 亚洲小说春色综合另类电影| 欧美高清视频一二三区| 国产一区二区在线影院| 综合久久久久久| 欧美人xxxx| 国产盗摄女厕一区二区三区| 亚洲女与黑人做爰| 欧美一区二区三区精品| 丁香婷婷综合激情五月色| 亚洲免费观看视频| 日韩视频免费观看高清完整版 | 日韩精品一二三| 久久色在线观看| 色狠狠桃花综合| 狠狠色综合色综合网络| 亚洲日本乱码在线观看| 日韩午夜电影av| 91麻豆视频网站| 久88久久88久久久| 亚洲综合视频在线| 久久久亚洲高清| 欧美日韩一区在线观看| 风间由美中文字幕在线看视频国产欧美| 一区二区三区在线视频免费观看| 精品乱人伦一区二区三区| 色婷婷精品久久二区二区蜜臀av| 免费观看一级特黄欧美大片| 日韩理论片网站| 久久久噜噜噜久噜久久综合| 欧美日免费三级在线| 豆国产96在线|亚洲| 久久国产欧美日韩精品| 艳妇臀荡乳欲伦亚洲一区| 欧美国产日本视频| 日韩免费福利电影在线观看| 欧美视频一区在线| 成人网页在线观看| 国产一区二区三区四| 日韩精品电影在线观看| 亚洲精品综合在线| 国产精品国产三级国产aⅴ原创| 精品美女在线观看| 欧美一区二区三区人| 欧美亚洲国产bt| 色婷婷综合久色| 97精品超碰一区二区三区| 国产91露脸合集magnet| 国内成人自拍视频| 精品一区二区三区视频在线观看| 午夜精品福利久久久| 亚洲网友自拍偷拍| 一级日本不卡的影视| 亚洲精品视频在线看| 国产精品传媒视频| 欧美极品xxx| 欧美国产欧美综合| 日本一区二区成人| 国产精品亲子伦对白| 中文字幕av一区 二区| 欧美激情一区二区三区不卡| 国产日韩影视精品| 国产欧美精品一区二区三区四区| 久久精品视频网| 国产欧美日产一区| 国产精品欧美一区二区三区| 国产精品三级电影| 国产精品国产a| 亚洲免费在线电影| 亚洲国产成人av| 视频在线观看91| 麻豆精品在线播放| 激情综合网av| 国产99一区视频免费 | 亚洲午夜久久久久久久久久久| 亚洲图片欧美激情| 一区二区免费在线| 天天综合日日夜夜精品| 日本亚洲欧美天堂免费| 美女尤物国产一区| 国产精品夜夜嗨| 成人免费电影视频| 91成人看片片| 欧美精品久久一区二区三区| 91精品欧美久久久久久动漫| 欧美精品一区二区三| 国产欧美日本一区视频| 一区二区三区91| 日本不卡123| 国产成人免费视频网站高清观看视频 | 精品一区二区三区免费| 国产精品一区久久久久| 99久久免费国产| 欧美日韩国产一区二区三区地区| 国产无人区一区二区三区| 国产精品大尺度| 午夜av电影一区| 国产成人在线视频网址| 91浏览器打开| 精品日本一线二线三线不卡| 国产精品久久久久久亚洲毛片| 亚洲一区av在线| 国产精品亚洲专一区二区三区| 99精品1区2区| 日韩三级精品电影久久久 | 制服.丝袜.亚洲.另类.中文| 久久精品欧美一区二区三区不卡| 亚洲欧美国产高清| 久久综合综合久久综合| 96av麻豆蜜桃一区二区| 日韩午夜精品视频| 亚洲视频网在线直播| 久久se这里有精品| 日本韩国一区二区三区| 久久综合九色综合97婷婷| 亚洲综合区在线| 国产成人超碰人人澡人人澡| 91精品欧美一区二区三区综合在| 国产精品美女久久久久久久久久久 | 丝袜a∨在线一区二区三区不卡| 国产乱码精品一区二区三区忘忧草| 色婷婷综合激情| 欧美高清在线一区二区| 裸体一区二区三区| 欧美性大战久久久久久久蜜臀| 国产无一区二区| 捆绑紧缚一区二区三区视频 | 欧美伦理电影网| 亚洲欧美在线高清| 国产乱国产乱300精品| 337p亚洲精品色噜噜| 久久久久亚洲蜜桃| 欧美精品日韩一区| 亚洲美女视频在线观看| 亚洲欧美日韩国产一区二区三区| 狠狠色狠狠色综合| 欧美老肥妇做.爰bbww视频| 亚洲欧美日韩一区二区 | 亚洲综合在线五月| 国产福利一区二区| 欧美大片在线观看| 日韩黄色免费网站| 欧美日韩在线播| 亚洲一区二区三区四区中文字幕 | 丝袜美腿亚洲一区二区图片| 日本精品视频一区二区三区| 国产精品你懂的| 成人免费观看视频| 国产精品私人影院| 成人动漫一区二区在线| 国产欧美精品在线观看| 国产成人免费av在线| 久久精品亚洲乱码伦伦中文| 国产精品18久久久久久vr| 欧美成人精品1314www| 老色鬼精品视频在线观看播放| 91精品国产品国语在线不卡| 日韩成人午夜精品| 日韩欧美国产成人一区二区| 麻豆国产精品视频| 精品欧美乱码久久久久久1区2区| 麻豆91精品视频| 久久在线观看免费| 国产白丝精品91爽爽久久| 国产欧美日韩一区二区三区在线观看| 国产aⅴ综合色| 亚洲人快播电影网| 欧美色电影在线| 美女免费视频一区二区| 亚洲精品在线免费观看视频| 欧美mv日韩mv亚洲| 久久亚洲综合av| 精品av久久707| 日韩欧美一区在线| 在线成人免费视频| 久久精品男人的天堂| 亚洲一区二区三区三| 欧美日本在线一区| 蓝色福利精品导航| 国产色综合久久| 色综合色综合色综合色综合色综合| 亚洲美女区一区| 91精品国产综合久久久久久| 国产一区二区伦理| 亚洲日本青草视频在线怡红院| 欧美嫩在线观看|