Top 100 java interview Question
Questions 1) What is the difference between String and StringBuffer...and what is that property called for String objects? 2) What will happen if u get an error in run() method of thread and if there is no try catch block for that? 3) What is Synchronization? 4) What is deadlock? 5) Write sample code using wait() and notify() methods? 6) If a thread has obtained a lock on an object. can other threads invoke non-synchronized methods on the same object? 7) Explain the Exception hierarchy? 8) What are the diff b/w checked exceptions and unchecked exceptions and errors? 9) How to write our own exceptions? And can we write them without using super() in that? 10) What is encapsulation? Why do u need that? 11) Difference b/w Readers and Streams in I/O? 12) How to open a file in read write mode? 13) There is a Date class in java.util. Is there any other package that has the Date class? 14) If we import java.util.Date and java.sql.Date and use Date d= new Date()..what happens? 15) What is...