Java_Advanced_Topics_Summary
Java_Advanced_Topics_Summary
1. Byte vs Character Streams: Byte streams (InputStream/OutputStream) handle binary data; Character
2. BufferedReader/Writer: Used for efficient I/O. BufferedReader reads lines; BufferedWriter writes with
buffering.
3. Serialization: Converts objects into byte stream using Serializable. Use ObjectOutputStream/InputStream.
6. JDBC Steps: Load driver, connect DB, create statement, execute query, close connection.
10. JDBC vs ODBC: JDBC is platform-independent and Java-specific; ODBC is native and not Java-specific.
13. ServerSocket/Socket: ServerSocket listens for clients; Socket connects and communicates.
15. Thread vs Runnable: Runnable is better for flexibility and multiple threads.
18. Thread Lifecycle: New -> Runnable -> Running -> Waiting/Blocked -> Terminated.
19. RMI Architecture: Includes stub, skeleton, remote interface, and registry.
20. RMI Steps: Define interface, implement it, register object, and create client.
21. Remote vs Serializable: Remote is for remote method calls; Serializable is for object transport.
23. JNI: Connects Java with C/C++ for native code execution.
24. JNI Integration: Write Java + native method, generate header, implement in C, compile.
25. JNI Pros/Cons: Access to native libraries but reduced portability and safety.
26. ArrayList vs LinkedList: ArrayList is fast for access; LinkedList is better for insertion/deletion.
27. HashMap vs Hashtable: HashMap is faster; Hashtable is thread-safe.
29. Set vs List: Set has no duplicates; List maintains order and allows duplicates.