Java Regular Expressions, Collections, and Data Structures Quiz
-
The class in Java that represents the compiled result of a regular expression string is: (C) A. Matcher B. Char C. Pattern D. None of the above
-
What does '[^abc]' represent in a regular expression? (B) A. Matches a, b, or c B. Does not include a, b, or c C. Matches '^', a, b, or c D. None of the above
-
What is the regular expression that represents any string? (A) A. '\w' B. '[a-zA-Z]' C. '\S' D. '\s'
-
How many groups are there in the regular expression '(\d{4})-(\d{2}-(\d\d))'? (A) A. 3 B. 4 C. 5 D. 1
-
Which statement about Collection and Collections is true? (D) A. Collections is used to save multiple collection elements B. Collection saves key-value compound elements C. Collections is the parent interface of the collection; Collection is an operations tool D. Collection is the parent interface of the collection; Collections is an operations tool
-
Which statement about HashSet and TreeSet is true? (B) A. HashSet saves elements in order, while TreeSet is unordered B. HashSet is unordered, while TreeSet is ordered C. Both HashSet and TreeSet are unordered D. Both HashSet and TreeSet are ordered
-
Which statement about the Comparable sorting interface and Comparator comparator is true? (A) A. Comparable is a natural sorting interface that identifies relative size between elements, while Comparator is a forced sorting interface. B. Comparable is a forced sorting interface, while Comparator is a natural sorting interface. C. Both Comparable and Comparator must implement the compareTo() method. D. There is no difference.
-
Which statement about the purpose of autoboxing and unboxing is true? (B) A. Autoboxing is the process of wrapping primitive data types into objects, while unboxing is the process of converting wrapper classes to primitive data types. B. Autoboxing is the process of wrapping primitive data types into objects, while unboxing is the process of converting wrapper classes to primitive data types. C. 3 D. 0
-
What is a more accurate way to loop through data in a List collection? (D) A. Traditional for loop B. For-each loop C. Iterator D. All of the above
-
What data structure does HashMap use to store elements? (B) A. Arrays B. Hash table C. Binary tree D. None of the above
原文地址: https://www.cveoy.top/t/topic/oct2 著作权归作者所有。请勿转载和采集!