Answer: Iterator is an interface which is used to step through the elements of a Collection. Is it helpful? Yes No Add Comment View Comments Ques 145. What is the main difference between a Vector and an ArrayList? Sometimes Vector is better; sometimes ArrayList is better; s...
Here comes the main part. Now, as we know that two unequal objects can have the same hash code value, how two different objects will be stored in the same array location [called bucket]. The answer isLinkedList. If you remember, Entry class had an attribute “next”. This attribute alwa...
This is one of the tough Java interview question and its open for all, my friend didn't know the answer so he didn't mind telling me. my take is that stored procedure should return error code if some operation fails but if stored procedure itself fail than catching SQLException is only ...
Open to all. In my opinion throwing exception from constructor is an option.Answer:This is similar to previous interview question. Since constructor of Singleton class is supposed to beprivateit prevents creating instance of Singleton from outside butReflection can access private fields and methods, ...
先创建InterviewQuestion类,该类包含一个answerQuestion方法,用于回答面试题。 publicclassInterviewQuestion{publicvoidanswerQuestion(){// TODO: 实现面试题的回答逻辑}} 1. 2. 3. 4. 5. 4. 创建Developer类 创建Developer类,该类包含一个interviewQuestion成员变量,表示要面试的问题。还需要一个askQuestion方法,用于...
题源参见 Grokking The Java Developer Interview: Question 15: Difference between error and exception Answer: Error: Errors in a program are irrecoverable, they indicate that something severe has gone wrong in the application and the program gets terminated in case of error occurrence e.g. running ...
Java Interview Questions/Java面试题 . What is transient variable? Transient variable can't be serialize. For example if a variable is declared as transient in a Serializable class and the class is written to an ObjectStream, the value of the variable can't be written to the stream instead ...
题源参见 Grokking The Java Developer Interview: Question 15: Difference between error and exception Answer: Error: Errors in a program are irrecoverable, they indicate that something severe has gone wrong in the application and the program gets terminated in case of error occurrence e.g. running ...
Java 8 has been released in March 2014, so it’s one of the hot topics in java interview questions. If you answer this question clearly, it will show that you like to keep yourself up-to-date with the latest technologies. Java 8 has been one of the biggest releases after Java 5 anno...
Let’s answer this Java coding interview question with the help of a table. HashMap HashTable 1. Better for non-threaded applications as it’s unsynchronized.1. Suited for threaded applications as it’s synchronized. 2. Only allows one null key.2. Doesn’t allow null in keys or values....