The document is a question bank for an advanced Java course focusing on the Java Collections Framework and String manipulation. It covers key concepts, differences between various collection types, and best practices for using collections in Java. Additionally, it addresses string handling, including immutability, comparison methods, and string manipulation techniques.
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)
3 views
Advance Java Question Bank
The document is a question bank for an advanced Java course focusing on the Java Collections Framework and String manipulation. It covers key concepts, differences between various collection types, and best practices for using collections in Java. Additionally, it addresses string handling, including immutability, comparison methods, and string manipulation techniques.
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/ 3
IAT1 2025 (ADVANCE JAVA QUESTION BANK)
1. What is the Java Collections Framework?
2. How does the Java Collections Framework improve code efficiency? 3. What are the main benefits of using collections instead of arrays? 4. Explain the hierarchy of the Java Collections Framework. 5. What are the key interfaces in the Java Collections Framework? 6. What is the difference between Collection and Collections in Java? 7. How does the List interface differ from the Set interface? 8. What is the purpose of the Queue interface? 9. Explain the difference between NavigableSet and SortedSet 10. Name some commonly used collection classes in Java. 11. What are the differences between ArrayList, LinkedList, and Vector? 12. How is HashSet different from TreeSet? 13. When should you use LinkedHashMap instead of HashMap? 14. What is an Iterator in Java? 15. How do you traverse a collection using an Iterator? 16. What is the difference between Iterator and ListIterator? 17. Why is the forEach method preferred over an explicit Iterator in Java 8? 18. How can you store user-defined objects in a collection? 19. What happens if you don’t override equals() and hashCode() while storing objects in HashSet? 20. How do you make a custom class sortable in a collection? 21. What is the RandomAccess interface? 22. How does RandomAccess improve performance for certain collections? 23. Which Java collection classes implement the RandomAccess interface? 24. What are the key differences between HashMap, TreeMap, and LinkedHashMap? 25. How does HashMap handle collisions? 26. Why is ConcurrentHashMap preferred in multi-threaded environments? 27. What is the difference between Hashtable and HashMap? 28. What is the difference between Comparable and Comparator? 29. How can you sort a list of objects using a Comparator? 30. Can you have multiple sorting criteria using Comparator? 31. What are some common algorithms provided by the Collections class? 32. How do you shuffle elements in a list? 33. What is the purpose of Collections.sort()? 34. How can you perform a binary search on a list? 35. How do you convert an array to a collection? 36. How does Arrays.asList() differ from List.of() in Java 9? 37. What is the difference between Arrays.sort() and Collections.sort()? 38. What are some legacy classes in Java Collections? 39. Why is Vector considered a legacy class? 40. How is Stack different from Deque in Java? 41. What are some best practices for using Java Collections? 42. How do you choose the right collection for a specific use case? 43. How do you ensure thread safety when working with collections? 44. How do you create a String in Java? 45. What are the different constructors available in the String class? 46. What happens when you create a string using new String("hello") versus "hello"? 47. How do you find the length of a string in Java? 48. What is the difference between length() in String and length in an array? 49. What is string immutability, and why is String immutable in Java? 50. How does Java handle string concatenation internally? 51. What are the benefits of using StringBuilder over String for string modifications? 52. How do you extract a single character from a string in Java? 53. What is the difference between charAt() and getChars() methods? 54. How does equals() differ from == when comparing strings? 55. What is the difference between compareTo() and equals()? 56. How can you perform a case-insensitive string comparison? 57. How do you check if a string contains a specific substring? 58. What is the difference between indexOf() and lastIndexOf()? 59. How can you check if a string starts or ends with a specific substring? 60. How can you replace characters in a string? 61. What is the difference between replace() and replaceAll()? 62. How do you remove leading and trailing spaces from a string? 63. How does String.valueOf() work? 64. How do you convert different data types (e.g., int, double, boolean) to a string? 65. How do you convert a string to lowercase or uppercase? 66. Does changing the case of a string modify the original string? 67. How do you concatenate strings in Java? 68. What is the difference between concat() and the + operator? 69. How can you join multiple strings efficiently in Java 8 and later? 70. What does the substring() method do? 71. How can you split a string into an array? 72. What is the purpose of matches() in the String class? 73. How do StringBuffer and StringBuilder differ from String? 74. What is the key difference between StringBuffer and StringBuilder? 75. Why is StringBuilder preferred in a single-threaded environment? 76. How do you append and insert text using StringBuffer or StringBuilder?