MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

arrays/AlphabeticSearch.java:11–19  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

9
10public class AlphabeticSearch {
11 public static void main(String[] args) {
12 String[] sa = new Rand.String().array(30);
13 Arrays.sort(sa, String.CASE_INSENSITIVE_ORDER);
14 show(sa);
15 int index = Arrays.binarySearch(sa,
16 sa[10], String.CASE_INSENSITIVE_ORDER);
17 System.out.println(
18 "Index: "+ index + "\n"+ sa[index]);
19 }
20}
21/* Output:
22[anmkkyh, bhmupju, btpenpc, cjwzmmr, cuxszgv, eloztdv,

Callers

nothing calls this directly

Calls 3

showMethod · 0.65
arrayMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected