ICSE Class 9-10 Java Packages and Classes
Question Answer
From which package do wrapper classes belong? java.lang
From which package does the Character class belong? java.lang
From which package does the Math class belong? java.lang
From which package does the String class belong? java.lang
From which package do string methods belong? java.lang
From which package do character methods belong? java.lang
From which package do mathematical functions like sqrt(), pow(), abs() belong?
java.lang
From which package does the Scanner class belong? java.util
From which package does the Random class belong? java.util
From which package does the ArrayList class belong? java.util
From which package does the System class belong? java.lang
From which package does the BufferedReader class belong? java.io
From which package does the InputStreamReader class belong? java.io
From which package does the Integer class belong? java.lang
From which package does the Double class belong? java.lang
From which package does the Float class belong? java.lang
From which package does the Boolean class belong? java.lang
From which package does the Long class belong? java.lang
From which package does the Byte class belong? java.lang
From which package does the Short class belong? java.lang
From which package does the LinkedList class belong? java.util
From which package does the HashMap class belong? java.util
From which package does the TreeSet class belong? java.util
From which package does the HashSet class belong? java.util
From which package does the File class belong? java.io
From which package does the PrintWriter class belong? java.io
From which package does the IOException class belong? java.io
From which package does the Exception class belong? java.lang
From which package does the Thread class belong? java.lang
From which package does the Runnable interface belong? java.lang
From which package does the Date class belong? java.util
From which package does the Calendar class belong? java.util
Additional Theory Questions
Q: What are wrapper classes?
A: Wrapper classes in Java convert primitive data types into objects. Example: Integer, Double, Character, etc.
Q: Why are wrapper classes required?
A: They allow primitive types to be used as objects, enabling functionalities like storing in collections, using in generics,
etc.
Q: What is autoboxing and unboxing?
A: Autoboxing: Converting a primitive type into its wrapper class automatically.
Unboxing: Converting a wrapper class object into its primitive type.
Q: Give examples of important methods from the Math class.
A: sqrt(n), pow(a, b), abs(n), max(a, b), min(a, b), random()
Q: What are some commonly used methods from the Character class?
A: isLetter(c), isDigit(c), isUpperCase(c), isLowerCase(c), toUpperCase(c), toLowerCase(c)
Q: What are some commonly used methods from the String class?
A: length(), charAt(index), toUpperCase(), toLowerCase(), substring(start, end), indexOf(ch), equals(str)