The document is a question bank for an Advanced Java course focused on String Handling and Collections Framework, detailing various concepts, methods, and programming tasks. It covers topics such as Java Strings, StringBuffer, String operations, and the Collection Framework's goals and methods. Additionally, it includes programming exercises related to strings and collections, such as checking for palindromes and anagrams.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
10 views2 pages
Aj BCS613D Ia1 QB
The document is a question bank for an Advanced Java course focused on String Handling and Collections Framework, detailing various concepts, methods, and programming tasks. It covers topics such as Java Strings, StringBuffer, String operations, and the Collection Framework's goals and methods. Additionally, it includes programming exercises related to strings and collections, such as checking for palindromes and anagrams.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
Advanced Java | IA-1 Question Bank | Mar-2025
Module-2: String Handling
1. Define Java Strings. Strings in Java are modifiable? If yes, explain how. Give the differences between String, StringBuffer and StringBuilder. 2. List out all the 9 Constructors of String Class explain each with Syntax and appropriate example code snippets. 3. Explain the following Special String Operations in Java: a. String Literals b. String Concatenation c. String Concatenation with Other Data Types 4. With appropriate example Show how toString() method is used for String Conversion and explain the importance of valueOf() method in String Conversion. 5. Explain how the following Character Extraction Methods work with syntax and example for each. a. charAt() b. getChars() c. getBytes() d. toCharArray() 6. Differentiate the following with respect to String Class using appropriate syntax and example: a. equals() and equalsIgnoreCase() b. startsWith() and endsWith() c. equals() and == d. regionMatches() and compareTo() e. indexOf() and lastIndexOf() 7. Explain how String Object is modified using the following methods with appropriate syntax and example a. substring() a. concat() b. replace() c. trim() 8. List-out the Constructors of StringBuffer class and explain each with syntax and example. 9. Explain the following methods with respect to StringBuffer Class with appropriate syntax and example a. length() b. setLength() c. capacity() d. ensureCapacity() e. setCharAt() 10. Explain the following methods with respect to StringBuffer Class with appropriate syntax and example for each; a. append() b. insert() c. reverse() d. deleteCharAt() e. replace() 11. Write a Java Program to check whether the given string is a Palindrome or Not. 12. Write a Java Program to Check Two Strings are Anagram of Each other or Not. 13. Write a Java Program to Swap Pairs of adjacent Characters in a given String.
Module-1: The Collections and Framework
1. Explain the Importance of Collections in Java by listing out the Goals of Collection Framework. 2. List-out the methods of Collection Interface and describe each with its appropriate syntax. 3. Explain the following methods of List Interface with appropriate Syntax and Example; a. add() b. remove() c. set() d. addAll() e. get() 4. Differentiate the following with respect to NavigableSet interface using Syntax of each and example for each a. first() and pollFirst() b. last() and pollLast() c. ceiling() and floor() d. higher() and lower() e. headSet() and tailSet() 5. List-out the methods of Queue Interface and describe each with its appropriate syntax and example. 6. Differentiate the following methods of Deque Interface a. getFirst() vs peekFirst() vs pollFirst() vs removeFirst() b. getLast() vs peekLast() vs pollLast() vs removeLast() c. addFirst() vs offerFirst() vs push() d. addLast() vs offerLast() vs pop() 7. List Out the methods of ListIterator and describe functionality and usage of each with its syntax and example. 8. Show how User-Defined Classes can be used as a type in Collection using an appropriate example program. 9. Write a Java Program to create ArrayList of Integers to print the same using Iterator and print in reverse order using ListIterartor. 10. Write a Java Program to create ArrayList of Integers and print the same using for-each loop by obtaining a Java array from the created ArrayList. 11. Create a Java Program to create LinkedList of Strings (LLS), then append each string of LLS with the string “MITM” and print the content of LLS.