This is one of the tough Java interview question and its open for all, my friend didn't knowthe 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 ch...
Design and implement a Polyline class ensuring that Polylines are immutable. Provide a method to add new Points to a Polyline.Why this Java programming question?Concurrent programming is notoriously difficult, but using immutable data structures where possible can make it considerably easier....
Answer:Garbage collection automatic process and can't be forced. Question:What is OOPS? Answer:OOP is the common abbreviation for Object-Oriented Programming. Question:Describe the principles of OOPS. Answer:There are three main principals of oops which are called Polymorphism, Inheritance and Encaps...
Question:What is Collection API? Answer:The Collection API is a set of classes and interfaces that support operation on collections of objects. These classes and interfaces are more flexible, more powerful, and more regular than the vectors, arrays, and hashtables if effectively replaces. Example...
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...
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,...
Garbage collection automatic process and can't be forced. 12What is OOPS? OOP is the common abbreviation for Object-Oriented Programming. 13Describe the principles of OOPS. There are three main principals of oops which are called Polymorphism, Inheritance and Encapsulation. ...
面试官:RabbitMQ-如何保证消息不丢失 候选人:嗯!我们当时MYSQL和Redis的数据双写一致性就是采用Rabbit...
Question:How you can force the garbage collection? Answer:Garbage collection automatic process and can't be forced. Question:What is OOPS? Answer:OOP is the common abbreviation for Object-Oriented Programming. Question:Describe the principles of OOPS. ...
(directory,config);}publicvoidaddEntry(Stringquestion,Stringanswer)throwsIOException{Documentdoc=newDocument();doc.add(newStringField("question",question,Field.Store.YES));doc.add(newStringField("answer",answer,Field.Store.YES));writer.addDocument(doc);}publicvoidclose()throwsIOException{writer.close...