Simple Java is a collection of frequently asked Java questions. It has been converted to pdf, you can download it here.
Foreword
1. Strings and Arrays
- What is string immutability?
- How does substring () work?
- Why string is immutable?
- Create Java string Using ” ” or constructor?
- Is string passed by reference?
- length vs. length ()
- How to check if an array contains a value efficiently?
- What is varargs?
- What exactly is null?
2. Common Methods
- Comparator vs. Comparable
- The contract between hashCode () and equals ()
- Java passes object by reference or by value?
- Iteration vs. recursion
3. Classes and Interfaces
- Overloading vs. overriding
- What is instance initializer?
- Fields can not be overridden?
- Inheritance vs. composition
- How to use Java Enum?
- How many types of inner classes?
- What is inner interface?
- Constructors of sub and super classes?
- 4 access levels
- When to use private constructors?
4. Collections & Generics
- Class hierarchy of Collection and Map
- A TreeSet example
- Deep understanding of Arrays.sort (T[], Comparator < ? super T > c)
- How do developers sort?
- ArrayList vs. LinkedList vs. Vector
- java.util.ConcurrentModificationException
- HashSet vs. TreeSet vs. LinkedHashSet
- HashMap vs. TreeMap vs. HashTable vs. LinkedHashMap
- Efficient counter
- Frequently used methods of HashMap
- What is type erasure?
- Why do we need generic types?
- Set vs. Set<?>
- What's the best way of converting Array to ArrayList?
5. Exceptions
- How exception handling works?
- Class hierarchy of exceptions
6. Concurrency
- Monitors – the key idea of Java synchronization
- How to make a method thread-safe?
- join ()
- notify () and wait ()
- Create thread by overriding
7. I/O & Database
- Read file line by line
- Write file line by line
- FileOutputStream vs. FileWriter
- Should .close () be put in finally block or not?
- Java serialization
- How to use properties file?
8. Compiler and JVM
- JVM run-time data areas
- How does Java handle aliasing?
- What does an array look like in memory?
- What is memory leak?
- What can be learned from "Hello World"?
- Whan and how a class is loaded and initialized?
- Static type checking
- Generate code for overloaded and overridden methods?
9. Top collections
- Top 10 mistakes Java developers make
- Top 10 methods for Java arrays
- Top 10 questions of Java strings
- Top 10 questions for Java regular expression
- Top 10 questions about Java exceptions
- Top 10 questions about Java collections
- Top 9 questions about Java maps
- The most widely used Java libraries
- Top 10 websites for advanced level Java developers
- Top 10 books for advanced level Java developers
- Top 100 High-quality Java blogs
- Top 10 algorithms for coding interview
- Top 8 diagrams for understanding Java
10. Popular Libraries, Frameworks and Tools
- Reflection tutorial
- What is framework?
- Why do we need Java web frameworks like Struts 2?
- What is Servlet Container? What is Tomcat?
- What is aspect-oriented Programming?
- Library vs. framework?
- Spring
- Open source projects using Spring framework
- Design patterns in stories
- Struts 2
- How CVS works?
- Why do we need software testing?
- Convert java jar file to exe
- Guava
- Log4j
- JSoup
- Swing
11. Others
- How to build your own library?
- How to get double?
- Java and computer science courses
- Java vs. Python: Basic Syntax, Date Types
- How to write a crawler?
- 8 things programmers can do at weekends
- Declaration, initialization and scoping
- Date formatting (add more)
- Path of package and class