[b]Retrieves the set of keys in a TreeMap object.[/b]
[b]Package:[/b] java.util
[b]Assembly:[/b] vjslib (in vjslib.dll)
[b]Return Value:[/b]
The set of keys contained in the TreeMap object.
[b]Example:[/b]
In this example, you create and initialize a TreeMap object, and then you display the keySet contained in the object.
引自:
[url]http://msdn.microsoft.com/zh-cn/library/aa989061(v=vs.80).aspx[/url]
-
[b]Package:[/b] java.util
[b]Assembly:[/b] vjslib (in vjslib.dll)
public java.util.Set keySet();
[b]Return Value:[/b]
The set of keys contained in the TreeMap object.
[b]Example:[/b]
In this example, you create and initialize a TreeMap object, and then you display the keySet contained in the object.
// TreeMap-keyset1.jsl
// TreeMap.keySet example
import java.util.*;
public class MyClass
{
public static void main(String[] args)
{
// Create a TreeMap object:
TreeMap tm = new TreeMap();
// Add some elements:
tm.put("3","Sally Abolrous");
tm.put("2","Craig Combel");
tm.put("5","Pille Mandla");
// Remove the key set:
System.out.println("The key set is: " + tm.keySet());
}
}
/*
Output:
The key set is: [2, 3, 5]
*/
引自:
[url]http://msdn.microsoft.com/zh-cn/library/aa989061(v=vs.80).aspx[/url]
-